@@ -5535,8 +5535,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
5535
5535
self .add_image (im )
5536
5536
return im
5537
5537
5538
- @staticmethod
5539
- def _pcolorargs (funcname , * args , shading = 'flat' ):
5538
+ def _pcolorargs (self , funcname , * args , shading = 'flat' , ** kwargs ):
5540
5539
# - create X and Y if not present;
5541
5540
# - reshape X and Y as needed if they are 1-D;
5542
5541
# - check for proper sizes based on `shading` kwarg;
@@ -5567,6 +5566,10 @@ def _pcolorargs(funcname, *args, shading='flat'):
5567
5566
# Check x and y for bad data...
5568
5567
C = np .asanyarray (args [2 ])
5569
5568
X , Y = [cbook .safe_masked_invalid (a ) for a in args [:2 ]]
5569
+ # unit conversion allows e.g. datetime objects as axis values
5570
+ self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
5571
+ X = self .convert_xunits (X )
5572
+ Y = self .convert_yunits (Y )
5570
5573
if funcname == 'pcolormesh' :
5571
5574
if np .ma .is_masked (X ) or np .ma .is_masked (Y ):
5572
5575
raise ValueError (
@@ -5815,14 +5818,10 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
5815
5818
if shading is None :
5816
5819
shading = rcParams ['pcolor.shading' ]
5817
5820
shading = shading .lower ()
5818
- X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading )
5821
+ X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
5822
+ kwargs = kwargs )
5819
5823
Ny , Nx = X .shape
5820
5824
5821
- # unit conversion allows e.g. datetime objects as axis values
5822
- self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
5823
- X = self .convert_xunits (X )
5824
- Y = self .convert_yunits (Y )
5825
-
5826
5825
# convert to MA, if necessary.
5827
5826
C = ma .asarray (C )
5828
5827
X = ma .asarray (X )
@@ -6091,14 +6090,10 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
6091
6090
kwargs .setdefault ('edgecolors' , 'None' )
6092
6091
6093
6092
X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
6094
- shading = shading )
6093
+ shading = shading , kwargs = kwargs )
6095
6094
Ny , Nx = X .shape
6096
6095
X = X .ravel ()
6097
6096
Y = Y .ravel ()
6098
- # unit conversion allows e.g. datetime objects as axis values
6099
- self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
6100
- X = self .convert_xunits (X )
6101
- Y = self .convert_yunits (Y )
6102
6097
6103
6098
# convert to one dimensional arrays
6104
6099
C = C .ravel ()
0 commit comments