@@ -5408,10 +5408,6 @@ def pcolor(self, *args, **kwargs):
5408
5408
X , Y , C = self ._pcolorargs ('pcolor' , * args , ** kw )
5409
5409
Ny , Nx = X .shape
5410
5410
5411
- if (isinstance (norm , mcolors .BivariateNorm ) or
5412
- isinstance (cmap , mcolors .BivariateColormap )):
5413
- norm = mcolors .NoNorm ()
5414
-
5415
5411
# unit conversion allows e.g. datetime objects as axis values
5416
5412
self ._process_unit_info (xdata = X , ydata = Y , kwargs = kwargs )
5417
5413
X = self .convert_xunits (X )
@@ -5426,7 +5422,10 @@ def pcolor(self, *args, **kwargs):
5426
5422
xymask = (mask [0 :- 1 , 0 :- 1 ] + mask [1 :, 1 :] +
5427
5423
mask [0 :- 1 , 1 :] + mask [1 :, 0 :- 1 ])
5428
5424
# don't plot if C or any of the surrounding vertices are masked.
5429
- mask = ma .getmaskarray (C ) + xymask
5425
+ if isinstance (norm , mcolors .BivariateNorm ):
5426
+ mask = ma .getmaskarray (C [0 ]) + ma .getmaskarray (C [1 ]) + xymask
5427
+ else :
5428
+ mask = ma .getmaskarray (C ) + xymask
5430
5429
5431
5430
newaxis = np .newaxis
5432
5431
compress = np .compress
@@ -5450,7 +5449,14 @@ def pcolor(self, *args, **kwargs):
5450
5449
axis = 1 )
5451
5450
verts = xy .reshape ((npoly , 5 , 2 ))
5452
5451
5453
- C = compress (ravelmask , ma .filled (C [0 :Ny - 1 , 0 :Nx - 1 ]).ravel ())
5452
+ if isinstance (norm , mcolors .BivariateNorm ):
5453
+ C0 = C [0 ]
5454
+ C1 = C [1 ]
5455
+ C0 = compress (ravelmask , ma .filled (C0 [0 :Ny - 1 , 0 :Nx - 1 ]).ravel ())
5456
+ C1 = compress (ravelmask , ma .filled (C1 [0 :Ny - 1 , 0 :Nx - 1 ]).ravel ())
5457
+ C = np .array ([C0 , C1 ])
5458
+ else :
5459
+ C = compress (ravelmask , ma .filled (C [0 :Ny - 1 , 0 :Nx - 1 ]).ravel ())
5454
5460
5455
5461
linewidths = (0.25 ,)
5456
5462
if 'linewidth' in kwargs :
@@ -5769,8 +5775,7 @@ def pcolorfast(self, *args, **kwargs):
5769
5775
isBivari = (isinstance (norm , mcolors .BivariateNorm )
5770
5776
or isinstance (cmap , mcolors .BivariateColormap ))
5771
5777
if (C .ndim == 3 and isBivari ):
5772
- C = norm (C )
5773
- nr , nc = C .shape
5778
+ nr , nc = C .shape [1 :]
5774
5779
else :
5775
5780
nr , nc = C .shape
5776
5781
if len (args ) == 1 :
0 commit comments