@@ -6208,6 +6208,21 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62086208 if shading is None :
62096209 shading = mpl .rcParams ['pcolor.shading' ]
62106210 shading = shading .lower ()
6211+
6212+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6213+ vmin = vmin ,
6214+ vmax = vmax )
6215+
6216+ # we need to get the colorizer object to know the number of
6217+ # n_variates that should exist in the array, we therefore get the
6218+ # colorizer here.
6219+ colorizer = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6220+ cmap = cmap ,
6221+ colorizer = colorizer )
6222+ if colorizer .norm .n_input > 1 :
6223+ data = mcolorizer ._ensure_multivariate_data (colorizer .norm .n_input , args [0 ])
6224+ args = (data , * args [1 :])
6225+
62116226 X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
62126227 kwargs = kwargs )
62136228 linewidths = (0.25 ,)
@@ -6244,9 +6259,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62446259 coords = stack ([X , Y ], axis = - 1 )
62456260
62466261 collection = mcoll .PolyQuadMesh (
6247- coords , array = C , cmap = cmap , norm = norm , colorizer = colorizer ,
6262+ coords , array = C , colorizer = colorizer ,
62486263 alpha = alpha , ** kwargs )
6249- collection ._check_exclusionary_keywords (colorizer , vmin = vmin , vmax = vmax )
62506264 collection ._scale_norm (norm , vmin , vmax )
62516265
62526266 # Transform from native to data coordinates?
@@ -6469,6 +6483,20 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64696483 shading = mpl ._val_or_rc (shading , 'pcolor.shading' ).lower ()
64706484 kwargs .setdefault ('edgecolors' , 'none' )
64716485
6486+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6487+ vmin = vmin ,
6488+ vmax = vmax )
6489+ # we need to get the colorizer object to know the number of
6490+ # n_variates that should exist in the array, we therefore get the
6491+ # colorizer here.
6492+ colorizer_obj = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6493+ cmap = cmap ,
6494+ colorizer = colorizer )
6495+ if colorizer_obj .norm .n_input > 1 :
6496+ data = mcolorizer ._ensure_multivariate_data (colorizer_obj .norm .n_input ,
6497+ args [- 1 ])
6498+ args = (* args [:- 1 ], data )
6499+
64726500 X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
64736501 shading = shading , kwargs = kwargs )
64746502 coords = np .stack ([X , Y ], axis = - 1 )
@@ -6477,8 +6505,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64776505
64786506 collection = mcoll .QuadMesh (
64796507 coords , antialiased = antialiased , shading = shading ,
6480- array = C , cmap = cmap , norm = norm , colorizer = colorizer , alpha = alpha , ** kwargs )
6481- collection . _check_exclusionary_keywords ( colorizer , vmin = vmin , vmax = vmax )
6508+ array = C , colorizer = colorizer_obj ,
6509+ alpha = alpha , ** kwargs )
64826510 collection ._scale_norm (norm , vmin , vmax )
64836511
64846512 coords = coords .reshape (- 1 , 2 ) # flatten the grid structure; keep x, y
0 commit comments