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

Function test_hexbin_log

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

Source from the content-addressed store, hash-verified

1064
1065@image_comparison(['hexbin_log.png'], style='mpl20')
1066def test_hexbin_log():
1067 # Issue #1636 (and also test log scaled colorbar)
1068
1069 np.random.seed(19680801)
1070 n = 100000
1071 x = np.random.standard_normal(n)
1072 y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
1073 y = np.power(2, y * 0.5)
1074
1075 fig, ax = plt.subplots()
1076 h = ax.hexbin(x, y, yscale='log', bins='log',
1077 marginals=True, reduce_C_function=np.sum)
1078 plt.colorbar(h)
1079
1080 # Make sure offsets are set
1081 assert h.get_offsets().shape == (11558, 2)
1082
1083
1084def test_hexbin_log_offsets():

Callers

nothing calls this directly

Calls 4

hexbinMethod · 0.80
get_offsetsMethod · 0.80
subplotsMethod · 0.45
colorbarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…