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

Function test_plot2D_samples_mat

test/test_plot.py:70–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69@pytest.mark.skipif(nogo, reason="Matplotlib not installed")
70def test_plot2D_samples_mat():
71 import ot
72 import ot.plot
73
74 n_bins = 50 # nb samples
75
76 mu_s = np.array([0, 0])
77 cov_s = np.array([[1, 0], [0, 1]])
78
79 mu_t = np.array([4, 4])
80 cov_t = np.array([[1, -0.8], [-0.8, 1]])
81
82 rng = np.random.RandomState(42)
83 xs = ot.datasets.make_2D_samples_gauss(n_bins, mu_s, cov_s, random_state=rng)
84 xt = ot.datasets.make_2D_samples_gauss(n_bins, mu_t, cov_t, random_state=rng)
85
86 G = 1.0 * (rng.rand(n_bins, n_bins) < 0.01)
87
88 ot.plot.plot2D_samples_mat(xs, xt, G, thr=1e-5)
89 ot.plot.plot2D_samples_mat(xs, xt, G, thr=1e-5, alpha=0.5)

Callers

nothing calls this directly

Calls 1

randMethod · 0.45

Tested by

no test coverage detected