@@ -9,17 +9,17 @@ def test_plot1D_mat():
99
1010 import ot
1111
12- n = 100 # nb bins
12+ n_bins = 100 # nb bins
1313
1414 # bin positions
15- x = np .arange (n , dtype = np .float64 )
15+ x = np .arange (n_bins , dtype = np .float64 )
1616
1717 # Gaussian distributions
18- a = ot .datasets .get_1D_gauss (n , m = 20 , s = 5 ) # m= mean, s= std
19- b = ot .datasets .get_1D_gauss (n , m = 60 , s = 10 )
18+ a = ot .datasets .get_1D_gauss (n_bins , m = 20 , s = 5 ) # m= mean, s= std
19+ b = ot .datasets .get_1D_gauss (n_bins , m = 60 , s = 10 )
2020
2121 # loss matrix
22- M = ot .dist (x .reshape ((n , 1 )), x .reshape ((n , 1 )))
22+ M = ot .dist (x .reshape ((n_bins , 1 )), x .reshape ((n_bins , 1 )))
2323 M /= M .max ()
2424
2525 ot .plot .plot1D_mat (a , b , M , 'Cost matrix M' )
@@ -29,17 +29,17 @@ def test_plot2D_samples_mat():
2929
3030 import ot
3131
32- n = 50 # nb samples
32+ n_bins = 50 # nb samples
3333
3434 mu_s = np .array ([0 , 0 ])
3535 cov_s = np .array ([[1 , 0 ], [0 , 1 ]])
3636
3737 mu_t = np .array ([4 , 4 ])
3838 cov_t = np .array ([[1 , - .8 ], [- .8 , 1 ]])
3939
40- xs = ot .datasets .get_2D_samples_gauss (n , mu_s , cov_s )
41- xt = ot .datasets .get_2D_samples_gauss (n , mu_t , cov_t )
40+ xs = ot .datasets .get_2D_samples_gauss (n_bins , mu_s , cov_s )
41+ xt = ot .datasets .get_2D_samples_gauss (n_bins , mu_t , cov_t )
4242
43- G = 1.0 * (np .random .rand (n , n ) < 0.01 )
43+ G = 1.0 * (np .random .rand (n_bins , n_bins ) < 0.01 )
4444
4545 ot .plot .plot2D_samples_mat (xs , xt , G , thr = 1e-5 )
0 commit comments