Skip to content

Commit 8374046

Browse files
committed
Add test for explicit norm=None.
1 parent 8caa0e6 commit 8374046

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_matrix.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,20 @@ def test_cmap_with_properties(self):
265265
hm = mat._HeatMapper(self.df_unif, **kws)
266266
npt.assert_array_equal(cmap(np.inf), hm.cmap(np.inf))
267267

268+
def test_explicit_none_norm(self):
269+
270+
vals = np.linspace(.2, 1, 9)
271+
cmap = mpl.cm.binary
272+
_, (ax1, ax2) = plt.subplots(2)
273+
274+
mat.heatmap([vals], vmin=0, cmap=cmap, ax=ax1)
275+
fc_default_norm = ax1.collections[0].get_facecolors()
276+
277+
mat.heatmap([vals], vmin=0, norm=None, cmap=cmap, ax=ax2)
278+
fc_explicit_norm = ax2.collections[0].get_facecolors()
279+
280+
npt.assert_array_almost_equal(fc_default_norm, fc_explicit_norm, 2)
281+
268282
def test_ticklabels_off(self):
269283
kws = self.default_kws.copy()
270284
kws['xticklabels'] = False

0 commit comments

Comments
 (0)