File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -155,3 +155,14 @@ def test_jpl_barh_units():
155
155
def test_empty_arrays ():
156
156
# Check that plotting an empty array with a dtype works
157
157
plt .scatter (np .array ([], dtype = 'datetime64[ns]' ), np .array ([]))
158
+
159
+
160
+ def test_scatter_element0_masked ():
161
+
162
+ times = np .arange ('2005-02' , '2005-03' , dtype = 'datetime64[D]' )
163
+
164
+ y = np .arange (len (times ), dtype = 'float' )
165
+ y [0 ] = np .nan
166
+ fig , ax = plt .subplots ()
167
+ ax .scatter (times , y )
168
+ fig .canvas .draw ()
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def default_units(x, axis):
45
45
from numbers import Number
46
46
47
47
import numpy as np
48
+ from numpy import ma
48
49
49
50
from matplotlib import cbook
50
51
@@ -128,6 +129,8 @@ def is_numlike(x):
128
129
"""
129
130
if np .iterable (x ):
130
131
for thisx in x :
132
+ if thisx is ma .masked :
133
+ continue
131
134
return isinstance (thisx , Number )
132
135
else :
133
136
return isinstance (x , Number )
You can’t perform that action at this time.
0 commit comments