diff options
Diffstat (limited to 'ot/plot.py')
-rw-r--r-- | ot/plot.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -38,3 +38,13 @@ def otplot1D(a,b,M,title=''): pl.xlim((0,nb)) +def otplot2D_samples(xs,xt,G,thr=1e-8,**kwargs): + """ Plot matrix M in 2D with lines using alpha values""" + if ('color' not in kwargs) and ('c' not in kwargs): + kwargs['color']='k' + mx=G.max() + for i in range(xs.shape[0]): + for j in range(xt.shape[0]): + if G[i,j]/mx>thr: + pl.plot([xs[i,0],xt[j,0]],[xs[i,1],xt[j,1]],alpha=G[i,j]/mx,**kwargs) +
\ No newline at end of file |