16
16
import matplotlib .collections as mcoll
17
17
import matplotlib .colors as mcolors
18
18
import matplotlib .contour as mcontour
19
- import matplotlib .dates as mdates
20
19
from matplotlib import docstring
21
20
import matplotlib .font_manager as font_manager
22
21
import matplotlib .image as mimage
@@ -6719,9 +6718,9 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
6719
6718
self ._process_unit_info (ydata = y2 )
6720
6719
6721
6720
# Convert the arrays so we can work with them
6722
- x = np . asanyarray (self .convert_xunits (x ))
6723
- y1 = np . asanyarray (self .convert_yunits (y1 ))
6724
- 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 ))
6725
6724
6726
6725
if y1 .ndim == 0 :
6727
6726
y1 = np .ones_like (x )* y1
@@ -6736,14 +6735,12 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
6736
6735
if not (x .shape == y1 .shape == y2 .shape == where .shape ):
6737
6736
raise ValueError ("Argument dimensions are incompatible" )
6738
6737
6739
- mask = reduce (ma .mask_or ,
6740
- [ma .getmask (x ), ma .getmask (y1 ), ma .getmask (y2 )])
6738
+ mask = reduce (ma .mask_or , [ma .getmask (a ) for a in (x , y1 , y2 )])
6741
6739
if mask is not ma .nomask :
6742
6740
where &= ~ mask
6743
6741
6744
6742
polys = []
6745
6743
for ind0 , ind1 in mlab .contiguous_regions (where ):
6746
- theseverts = []
6747
6744
xslice = x [ind0 :ind1 ]
6748
6745
y1slice = y1 [ind0 :ind1 ]
6749
6746
y2slice = y2 [ind0 :ind1 ]
@@ -6853,9 +6850,9 @@ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
6853
6850
self ._process_unit_info (xdata = x2 )
6854
6851
6855
6852
# Convert the arrays so we can work with them
6856
- y = np . asanyarray (self .convert_yunits (y ))
6857
- x1 = np . asanyarray (self .convert_xunits (x1 ))
6858
- 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 ))
6859
6856
6860
6857
if x1 .ndim == 0 :
6861
6858
x1 = np .ones_like (y )* x1
@@ -6870,14 +6867,12 @@ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
6870
6867
if not (y .shape == x1 .shape == x2 .shape == where .shape ):
6871
6868
raise ValueError ("Argument dimensions are incompatible" )
6872
6869
6873
- mask = reduce (ma .mask_or ,
6874
- [ma .getmask (y ), ma .getmask (x1 ), ma .getmask (x2 )])
6870
+ mask = reduce (ma .mask_or , [ma .getmask (a ) for a in (y , x1 , x2 )])
6875
6871
if mask is not ma .nomask :
6876
6872
where &= ~ mask
6877
6873
6878
6874
polys = []
6879
6875
for ind0 , ind1 in mlab .contiguous_regions (where ):
6880
- theseverts = []
6881
6876
yslice = y [ind0 :ind1 ]
6882
6877
x1slice = x1 [ind0 :ind1 ]
6883
6878
x2slice = x2 [ind0 :ind1 ]
0 commit comments