MCPcopy Create free account
hub / github.com/PythonOT/POT / test_plot1D_mat

Function test_plot1D_mat

test/test_plot.py:21–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20@pytest.mark.skipif(nogo, reason="Matplotlib not installed")
21def test_plot1D_mat():
22 import ot
23 import ot.plot
24
25 n_bins = 100 # nb bins
26
27 # bin positions
28 x = np.arange(n_bins, dtype=np.float64)
29
30 # Gaussian distributions
31 a = ot.datasets.make_1D_gauss(n_bins, m=20, s=5) # m= mean, s= std
32 b = ot.datasets.make_1D_gauss(n_bins, m=60, s=10)
33
34 # loss matrix
35 M = ot.dist(x.reshape((n_bins, 1)), x.reshape((n_bins, 1)))
36 M /= M.max()
37
38 ot.plot.plot1D_mat(a, b, M)
39 ot.plot.plot1D_mat(a, b, M, plot_style="xy")
40
41 with pytest.raises(AssertionError):
42 ot.plot.plot1D_mat(a, b, M, plot_style="NotAValidStyle")
43
44
45@pytest.mark.skipif(nogo, reason="Matplotlib not installed")

Callers

nothing calls this directly

Calls 3

arangeMethod · 0.45
reshapeMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected