44
55
66import numpy as np
7- import matplotlib .pylab as plt
7+ import matplotlib .pylab as pl
88from matplotlib import gridspec
99
1010
@@ -31,24 +31,24 @@ def plot1D_mat(a, b, M, title=''):
3131 xa = np .arange (na )
3232 xb = np .arange (nb )
3333
34- ax1 = plt .subplot (gs [0 , 1 :])
35- plt .plot (xb , b , 'r' , label = 'Target distribution' )
36- plt .yticks (())
37- plt .title (title )
34+ ax1 = pl .subplot (gs [0 , 1 :])
35+ pl .plot (xb , b , 'r' , label = 'Target distribution' )
36+ pl .yticks (())
37+ pl .title (title )
3838
39- ax2 = plt .subplot (gs [1 :, 0 ])
40- plt .plot (a , xa , 'b' , label = 'Source distribution' )
41- plt .gca ().invert_xaxis ()
42- plt .gca ().invert_yaxis ()
43- plt .xticks (())
39+ ax2 = pl .subplot (gs [1 :, 0 ])
40+ pl .plot (a , xa , 'b' , label = 'Source distribution' )
41+ pl .gca ().invert_xaxis ()
42+ pl .gca ().invert_yaxis ()
43+ pl .xticks (())
4444
45- plt .subplot (gs [1 :, 1 :], sharex = ax1 , sharey = ax2 )
46- plt .imshow (M , interpolation = 'nearest' )
47- plt .axis ('off' )
45+ pl .subplot (gs [1 :, 1 :], sharex = ax1 , sharey = ax2 )
46+ pl .imshow (M , interpolation = 'nearest' )
47+ pl .axis ('off' )
4848
49- plt .xlim ((0 , nb ))
50- plt .tight_layout ()
51- plt .subplots_adjust (wspace = 0. , hspace = 0.2 )
49+ pl .xlim ((0 , nb ))
50+ pl .tight_layout ()
51+ pl .subplots_adjust (wspace = 0. , hspace = 0.2 )
5252
5353
5454def plot2D_samples_mat (xs , xt , G , thr = 1e-8 , ** kwargs ):
@@ -78,5 +78,5 @@ def plot2D_samples_mat(xs, xt, G, thr=1e-8, **kwargs):
7878 for i in range (xs .shape [0 ]):
7979 for j in range (xt .shape [0 ]):
8080 if G [i , j ] / mx > thr :
81- plt .plot ([xs [i , 0 ], xt [j , 0 ]], [xs [i , 1 ], xt [j , 1 ]],
82- alpha = G [i , j ] / mx , ** kwargs )
81+ pl .plot ([xs [i , 0 ], xt [j , 0 ]], [xs [i , 1 ], xt [j , 1 ]],
82+ alpha = G [i , j ] / mx , ** kwargs )
0 commit comments