@@ -5422,8 +5422,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
5422
5422
self .add_image (im )
5423
5423
return im
5424
5424
5425
- @staticmethod
5426
- def _pcolorargs (funcname , * args , shading = 'flat' ):
5425
+ def _pcolorargs (self , funcname , * args , shading = 'flat' , ** kwargs ):
5427
5426
# - create X and Y if not present;
5428
5427
# - reshape X and Y as needed if they are 1-D;
5429
5428
# - check for proper sizes based on `shading` kwarg;
@@ -5454,6 +5453,9 @@ def _pcolorargs(funcname, *args, shading='flat'):
5454
5453
# Check x and y for bad data...
5455
5454
C = np .asanyarray (args [2 ])
5456
5455
X , Y = [cbook .safe_masked_invalid (a ) for a in args [:2 ]]
5456
+ # unit conversion allows e.g. datetime objects as axis values
5457
+ X , Y = self ._process_unit_info ([("x" , X ), ("y" , Y )], kwargs )
5458
+
5457
5459
if funcname == 'pcolormesh' :
5458
5460
if np .ma .is_masked (X ) or np .ma .is_masked (Y ):
5459
5461
raise ValueError (
@@ -5702,12 +5704,10 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
5702
5704
if shading is None :
5703
5705
shading = rcParams ['pcolor.shading' ]
5704
5706
shading = shading .lower ()
5705
- X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading )
5707
+ X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
5708
+ kwargs = kwargs )
5706
5709
Ny , Nx = X .shape
5707
5710
5708
- # unit conversion allows e.g. datetime objects as axis values
5709
- X , Y = self ._process_unit_info ([("x" , X ), ("y" , Y )], kwargs )
5710
-
5711
5711
# convert to MA, if necessary.
5712
5712
C = ma .asarray (C )
5713
5713
X = ma .asarray (X )
@@ -5976,12 +5976,10 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
5976
5976
kwargs .setdefault ('edgecolors' , 'None' )
5977
5977
5978
5978
X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
5979
- shading = shading )
5979
+ shading = shading , kwargs = kwargs )
5980
5980
Ny , Nx = X .shape
5981
5981
X = X .ravel ()
5982
5982
Y = Y .ravel ()
5983
- # unit conversion allows e.g. datetime objects as axis values
5984
- X , Y = self ._process_unit_info ([("x" , X ), ("y" , Y )], kwargs )
5985
5983
5986
5984
# convert to one dimensional arrays
5987
5985
C = C .ravel ()
0 commit comments