@@ -6258,6 +6258,21 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62586258 if shading is None :
62596259 shading = mpl .rcParams ['pcolor.shading' ]
62606260 shading = shading .lower ()
6261+
6262+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6263+ vmin = vmin ,
6264+ vmax = vmax )
6265+
6266+ # we need to get the colorizer object to know the number of
6267+ # n_variates that should exist in the array, we therefore get the
6268+ # colorizer here.
6269+ colorizer = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6270+ cmap = cmap ,
6271+ colorizer = colorizer )
6272+ if colorizer .norm .n_input > 1 :
6273+ data = mcolorizer ._ensure_multivariate_data (colorizer .norm .n_input , args [0 ])
6274+ args = (data , * args [1 :])
6275+
62616276 X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
62626277 kwargs = kwargs )
62636278 linewidths = (0.25 ,)
@@ -6294,9 +6309,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62946309 coords = stack ([X , Y ], axis = - 1 )
62956310
62966311 collection = mcoll .PolyQuadMesh (
6297- coords , array = C , cmap = cmap , norm = norm , colorizer = colorizer ,
6312+ coords , array = C , colorizer = colorizer ,
62986313 alpha = alpha , ** kwargs )
6299- collection ._check_exclusionary_keywords (colorizer , vmin = vmin , vmax = vmax )
63006314 collection ._scale_norm (norm , vmin , vmax )
63016315
63026316 # Transform from native to data coordinates?
@@ -6519,6 +6533,20 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
65196533 shading = mpl ._val_or_rc (shading , 'pcolor.shading' ).lower ()
65206534 kwargs .setdefault ('edgecolors' , 'none' )
65216535
6536+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6537+ vmin = vmin ,
6538+ vmax = vmax )
6539+ # we need to get the colorizer object to know the number of
6540+ # n_variates that should exist in the array, we therefore get the
6541+ # colorizer here.
6542+ colorizer_obj = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6543+ cmap = cmap ,
6544+ colorizer = colorizer )
6545+ if colorizer_obj .norm .n_input > 1 :
6546+ data = mcolorizer ._ensure_multivariate_data (colorizer_obj .norm .n_input ,
6547+ args [- 1 ])
6548+ args = (* args [:- 1 ], data )
6549+
65226550 X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
65236551 shading = shading , kwargs = kwargs )
65246552 coords = np .stack ([X , Y ], axis = - 1 )
@@ -6527,8 +6555,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
65276555
65286556 collection = mcoll .QuadMesh (
65296557 coords , antialiased = antialiased , shading = shading ,
6530- array = C , cmap = cmap , norm = norm , colorizer = colorizer , alpha = alpha , ** kwargs )
6531- collection . _check_exclusionary_keywords ( colorizer , vmin = vmin , vmax = vmax )
6558+ array = C , colorizer = colorizer_obj ,
6559+ alpha = alpha , ** kwargs )
65326560 collection ._scale_norm (norm , vmin , vmax )
65336561
65346562 coords = coords .reshape (- 1 , 2 ) # flatten the grid structure; keep x, y
0 commit comments