Skip to content

Commit 1c48706

Browse files
author
Clement Gilli
committed
add test hexbin_string_norm
1 parent 1ea3239 commit 1c48706

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,13 @@ def test_hexbin_bad_extents():
976976
with pytest.raises(ValueError, match="In extent, ymax must be greater than ymin"):
977977
ax.hexbin(x, y, extent=(0, 1, 1, 0))
978978

979+
def test_hexbin_string_norm():
980+
fig, ax = plt.subplots()
981+
hex = ax.hexbin(np.random.rand(10), np.random.rand(10), norm="log",vmin=2,vmax=5)
982+
assert isinstance(hex,matplotlib.collections.PolyCollection)
983+
assert isinstance(hex.norm,matplotlib.colors.LogNorm)
984+
assert hex.norm.vmin == 2
985+
assert hex.norm.vmax == 5
979986

980987
@image_comparison(['hexbin_empty.png'], remove_text=True)
981988
def test_hexbin_empty():

0 commit comments

Comments
 (0)