@@ -6718,9 +6718,9 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
6718
6718
self ._process_unit_info (ydata = y2 )
6719
6719
6720
6720
# Convert the arrays so we can work with them
6721
- x = np . asanyarray (self .convert_xunits (x ))
6722
- y1 = np . asanyarray (self .convert_yunits (y1 ))
6723
- y2 = np . asanyarray (self .convert_yunits (y2 ))
6721
+ x = ma . masked_invalid (self .convert_xunits (x ))
6722
+ y1 = ma . masked_invalid (self .convert_yunits (y1 ))
6723
+ y2 = ma . masked_invalid (self .convert_yunits (y2 ))
6724
6724
6725
6725
if y1 .ndim == 0 :
6726
6726
y1 = np .ones_like (x )* y1
@@ -6735,8 +6735,7 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
6735
6735
if not (x .shape == y1 .shape == y2 .shape == where .shape ):
6736
6736
raise ValueError ("Argument dimensions are incompatible" )
6737
6737
6738
- mask = reduce (ma .mask_or , [f (a ) for f in (ma .getmask , np .isnan )
6739
- for a in (x , y1 , y2 )])
6738
+ mask = reduce (ma .mask_or , [ma .getmask (a ) for a in (x , y1 , y2 )])
6740
6739
if mask is not ma .nomask :
6741
6740
where &= ~ mask
6742
6741
@@ -6851,9 +6850,9 @@ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
6851
6850
self ._process_unit_info (xdata = x2 )
6852
6851
6853
6852
# Convert the arrays so we can work with them
6854
- y = np . asanyarray (self .convert_yunits (y ))
6855
- x1 = np . asanyarray (self .convert_xunits (x1 ))
6856
- x2 = np . asanyarray (self .convert_xunits (x2 ))
6853
+ y = ma . masked_invalid (self .convert_yunits (y ))
6854
+ x1 = ma . masked_invalid (self .convert_xunits (x1 ))
6855
+ x2 = ma . masked_invalid (self .convert_xunits (x2 ))
6857
6856
6858
6857
if x1 .ndim == 0 :
6859
6858
x1 = np .ones_like (y )* x1
@@ -6868,8 +6867,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
6868
6867
if not (y .shape == x1 .shape == x2 .shape == where .shape ):
6869
6868
raise ValueError ("Argument dimensions are incompatible" )
6870
6869
6871
- mask = reduce (ma .mask_or , [f (a ) for f in (ma .getmask , np .isnan )
6872
- for a in (y , x1 , x2 )])
6870
+ mask = reduce (ma .mask_or , [ma .getmask (a ) for a in (y , x1 , x2 )])
6873
6871
if mask is not ma .nomask :
6874
6872
where &= ~ mask
6875
6873
0 commit comments