@@ -5455,8 +5455,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
5455
5455
self .add_image (im )
5456
5456
return im
5457
5457
5458
- @staticmethod
5459
- def _pcolorargs (funcname , * args , shading = 'flat' ):
5458
+ def _pcolorargs (self , funcname , * args , shading = 'flat' , ** kwargs ):
5460
5459
# - create X and Y if not present;
5461
5460
# - reshape X and Y as needed if they are 1-D;
5462
5461
# - check for proper sizes based on `shading` kwarg;
@@ -5487,6 +5486,11 @@ def _pcolorargs(funcname, *args, shading='flat'):
5487
5486
# Check x and y for bad data...
5488
5487
C = np .asanyarray (args [2 ])
5489
5488
X , Y = [cbook .safe_masked_invalid (a ) for a in args [:2 ]]
5489
+ # unit conversion allows e.g. datetime objects as axis values
5490
+ self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
5491
+ X = self .convert_xunits (X )
5492
+ Y = self .convert_yunits (Y )
5493
+
5490
5494
if funcname == 'pcolormesh' :
5491
5495
if np .ma .is_masked (X ) or np .ma .is_masked (Y ):
5492
5496
raise ValueError (
@@ -5735,14 +5739,10 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
5735
5739
if shading is None :
5736
5740
shading = rcParams ['pcolor.shading' ]
5737
5741
shading = shading .lower ()
5738
- X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading )
5742
+ X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
5743
+ ** kwargs )
5739
5744
Ny , Nx = X .shape
5740
5745
5741
- # unit conversion allows e.g. datetime objects as axis values
5742
- self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
5743
- X = self .convert_xunits (X )
5744
- Y = self .convert_yunits (Y )
5745
-
5746
5746
# convert to MA, if necessary.
5747
5747
C = ma .asarray (C )
5748
5748
X = ma .asarray (X )
@@ -6011,14 +6011,10 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
6011
6011
kwargs .setdefault ('edgecolors' , 'None' )
6012
6012
6013
6013
X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
6014
- shading = shading )
6014
+ shading = shading , ** kwargs )
6015
6015
Ny , Nx = X .shape
6016
6016
X = X .ravel ()
6017
6017
Y = Y .ravel ()
6018
- # unit conversion allows e.g. datetime objects as axis values
6019
- self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
6020
- X = self .convert_xunits (X )
6021
- Y = self .convert_yunits (Y )
6022
6018
6023
6019
# convert to one dimensional arrays
6024
6020
C = C .ravel ()
0 commit comments