8000 added test for hexbin linear axes. closes #21165 · j-bowhay/matplotlib@592620f · GitHub
[go: up one dir, main page]

Skip to content

Commit 592620f

Browse files
author
Jake Bowhay
committed
added test for hexbin linear axes. closes matplotlib#21165
1 parent be3608b commit 592620f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,29 @@ def test_hexbin_log():
786786
plt.colorbar(h)
787787

788788

789+
@image_comparison(["hexbin_linear.png"], style="mpl20")
790+
def test_hexbin_linear():
791+
# Issue #21165
792+
793+
# Remove this line when this test image is regenerated.
794+
plt.rcParams["pcolormesh.snap"] = False
795+
796+
np.random.seed(19680801)
797+
n = 100000
798+
x = np.random.standard_normal(n)
799+
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
800+
801+
xmin = x.min()
802+
xmax = x.max()
803+
ymin = y.min()
804+
ymax = y.max()
805+
806+
fig, ax = plt.subplots()
807+
ax.axis([xmin, xmax, ymin, ymax])
808+
h = ax.hexbin(x, y, marginals=True, reduce_C_function=np.sum)
809+
plt.colorbar(h)
810+
811+
789812
def test_hexbin_log_clim():
790813
x, y = np.arange(200).reshape((2, 100))
791814
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)
0