7
7
from numpy .testing .utils import assert_array_equal
8
8
import matplotlib .colors as mcolors
9
9
import matplotlib .cm as cm
10
+ import matplotlib .pyplot as plt
11
+ from matplotlib .testing .decorators import cleanup
12
+
10
13
11
14
def test_colormap_endian ():
12
15
"""
@@ -23,6 +26,7 @@ def test_colormap_endian():
23
26
#print(anative.dtype.isnative, aforeign.dtype.isnative)
24
27
assert_array_equal (cmap (anative ), cmap (aforeign ))
25
28
29
+
26
30
def test_BoundaryNorm ():
27
31
"""
28
32
Github issue #1258: interpolation was failing with numpy
@@ -36,6 +40,7 @@ def test_BoundaryNorm():
36
40
ncolors = len (boundaries )
37
41
bn = mcolors .BoundaryNorm (boundaries , ncolors )
38
42
assert_array_equal (bn (vals ), expected )
43
+
39
44
40
45
def test_LogNorm ():
41
46
"""
@@ -46,3 +51,10 @@ def test_LogNorm():
46
51
ln = mcolors .LogNorm (clip = True , vmax = 5 )
47
52
assert_array_equal (ln ([1 , 6 ]), [0 , 1.0 ])
48
53
54
+
55
+ @cleanup
56
+ def test_autoscale_masked ():
57
+ # Test for #2336. Previously fully masked data would trigger a ValueError.
58
+ data = np .ma .masked_all ((12 , 20 ))
59
+ plt .pcolor (data )
60
+ plt .draw ()
0 commit comments