Skip to content

Commit d6091da

Browse files
committed
more
1 parent c5a72cc commit d6091da

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

examples/plot_OT_1D.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
import numpy as np
11-
import matplotlib.pylab as plt
11+
import matplotlib.pylab as pl
1212
import ot
1313
from ot.datasets import get_1D_gauss as gauss
1414

@@ -29,29 +29,29 @@
2929

3030
#%% plot the distributions
3131

32-
plt.figure(1)
33-
plt.plot(x, a, 'b', label='Source distribution')
34-
plt.plot(x, b, 'r', label='Target distribution')
35-
plt.legend()
32+
pl.figure(1, figsize=(6.4, 3))
33+
pl.plot(x, a, 'b', label='Source distribution')
34+
pl.plot(x, b, 'r', label='Target distribution')
35+
pl.legend()
3636

3737
#%% plot distributions and loss matrix
3838

39-
plt.figure(2, figsize=(5, 5))
39+
pl.figure(2, figsize=(5, 5))
4040
ot.plot.plot1D_mat(a, b, M, 'Cost matrix M')
4141

4242
#%% EMD
4343

4444
G0 = ot.emd(a, b, M)
4545

46-
plt.figure(3, figsize=(5, 5))
46+
pl.figure(3, figsize=(5, 5))
4747
ot.plot.plot1D_mat(a, b, G0, 'OT matrix G0')
4848

4949
#%% Sinkhorn
5050

5151
lambd = 1e-3
5252
Gs = ot.sinkhorn(a, b, M, lambd, verbose=True)
5353

54-
plt.figure(4, figsize=(5, 5))
54+
pl.figure(4, figsize=(5, 5))
5555
ot.plot.plot1D_mat(a, b, Gs, 'OT matrix Sinkhorn')
5656

57-
plt.show()
57+
pl.show()

examples/plot_optim_OTreg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
G0 = ot.emd(a, b, M)
3333

34-
pl.figure(3)
34+
pl.figure(3, figsize=(5, 5))
3535
ot.plot.plot1D_mat(a, b, G0, 'OT matrix G0')
3636

3737
#%% Example with Frobenius norm regularization
@@ -64,7 +64,7 @@ def df(G):
6464

6565
Ge = ot.optim.cg(a, b, M, reg, f, df, verbose=True)
6666

67-
pl.figure(4)
67+
pl.figure(4, figsize=(5, 5))
6868
ot.plot.plot1D_mat(a, b, Ge, 'OT matrix Entrop. reg')
6969

7070
#%% Example with Frobenius norm + entropic regularization with gcg
@@ -82,6 +82,6 @@ def df(G):
8282

8383
Gel2 = ot.optim.gcg(a, b, M, reg1, reg2, f, df, verbose=True)
8484

85-
pl.figure(5)
85+
pl.figure(5, figsize=(5, 5))
8686
ot.plot.plot1D_mat(a, b, Gel2, 'OT entropic + matrix Frob. reg')
8787
pl.show()

0 commit comments

Comments
 (0)