MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_hist2d

Function test_hist2d

lib/matplotlib/tests/test_axes.py:2876–2890  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2874
2875@image_comparison(['hist2d.png', 'hist2d.png'], remove_text=True, style='mpl20')
2876def test_hist2d():
2877 # Remove this line when this test image is regenerated.
2878 plt.rcParams['pcolormesh.snap'] = False
2879
2880 np.random.seed(0)
2881 # make it not symmetric in case we switch x and y axis
2882 x = np.random.randn(100)*2+5
2883 y = np.random.randn(100)-2
2884 fig, ax = plt.subplots()
2885 ax.hist2d(x, y, bins=10, rasterized=True)
2886
2887 # Reuse testcase from above for a labeled data test
2888 data = {"x": x, "y": y}
2889 fig, ax = plt.subplots()
2890 ax.hist2d("x", "y", bins=10, data=data, rasterized=True)
2891
2892
2893@image_comparison(['hist2d_transpose.png'], remove_text=True, style='mpl20')

Callers

nothing calls this directly

Calls 2

hist2dMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…