@@ -6165,6 +6165,21 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
61656165 if shading is None :
61666166 shading = mpl .rcParams ['pcolor.shading' ]
61676167 shading = shading .lower ()
6168+
6169+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6170+ vmin = vmin ,
6171+ vmax = vmax )
6172+
6173+ # we need to get the colorizer object to know the number of
6174+ # n_variates that should exist in the array, we therefore get the
6175+ # colorizer here.
6176+ colorizer = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6177+ cmap = cmap ,
6178+ colorizer = colorizer )
6179+ if colorizer .norm .n_input > 1 :
6180+ data = mcolorizer ._ensure_multivariate_data (colorizer .norm .n_input , args [0 ])
6181+ args = (data , * args [1 :])
6182+
61686183 X , Y , C , shading = self ._pcolorargs ('pcolor' , * args , shading = shading ,
61696184 kwargs = kwargs )
61706185 linewidths = (0.25 ,)
@@ -6201,9 +6216,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62016216 coords = stack ([X , Y ], axis = - 1 )
62026217
62036218 collection = mcoll .PolyQuadMesh (
6204- coords , array = C , cmap = cmap , norm = norm , colorizer = colorizer ,
6219+ coords , array = C , colorizer = colorizer ,
62056220 alpha = alpha , ** kwargs )
6206- collection ._check_exclusionary_keywords (colorizer , vmin = vmin , vmax = vmax )
62076221 collection ._scale_norm (norm , vmin , vmax )
62086222
62096223 # Transform from native to data coordinates?
@@ -6428,6 +6442,20 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64286442 shading = shading .lower ()
64296443 kwargs .setdefault ('edgecolors' , 'none' )
64306444
6445+ mcolorizer .ColorizingArtist ._check_exclusionary_keywords (colorizer ,
6446+ vmin = vmin ,
6447+ vmax = vmax )
6448+ # we need to get the colorizer object to know the number of
6449+ # n_variates that should exist in the array, we therefore get the
6450+ # colorizer here.
6451+ colorizer_obj = mcolorizer .ColorizingArtist ._get_colorizer (norm = norm ,
6452+ cmap = cmap ,
6453+ colorizer = colorizer )
6454+ if colorizer_obj .norm .n_input > 1 :
6455+ data = mcolorizer ._ensure_multivariate_data (colorizer_obj .norm .n_input ,
6456+ args [- 1 ])
6457+ args = (* args [:- 1 ], data )
6458+
64316459 X , Y , C , shading = self ._pcolorargs ('pcolormesh' , * args ,
64326460 shading = shading , kwargs = kwargs )
64336461 coords = np .stack ([X , Y ], axis = - 1 )
@@ -6436,8 +6464,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64366464
64376465 collection = mcoll .QuadMesh (
64386466 coords , antialiased = antialiased , shading = shading ,
6439- array = C , cmap = cmap , norm = norm , colorizer = colorizer , alpha = alpha , ** kwargs )
6440- collection . _check_exclusionary_keywords ( colorizer , vmin = vmin , vmax = vmax )
6467+ array = C , colorizer = colorizer_obj ,
6468+ alpha = alpha , ** kwargs )
64416469 collection ._scale_norm (norm , vmin , vmax )
64426470
64436471 coords = coords .reshape (- 1 , 2 ) # flatten the grid structure; keep x, y
0 commit comments