@@ -6231,6 +6231,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
6231
6231
collection ._check_exclusionary_keywords (colorizer , vmin = vmin , vmax = vmax )
6232
6232
collection ._scale_norm (norm , vmin , vmax )
6233
6233
6234
+ coords = coords .reshape (- 1 , 2 ) # flatten the grid structure; keep x, y
6235
+
6234
6236
# Transform from native to data coordinates?
6235
6237
t = collection ._transform
6236
6238
if (not isinstance (t , mtransforms .Transform ) and
@@ -6239,20 +6241,15 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
6239
6241
6240
6242
if t and any (t .contains_branch_seperately (self .transData )):
6241
6243
trans_to_data = t - self .transData
6242
- pts = np .vstack ([x , y ]).T .astype (float )
6243
- transformed_pts = trans_to_data .transform (pts )
6244
- x = transformed_pts [..., 0 ]
6245
- y = transformed_pts [..., 1 ]
6244
+ coords = trans_to_data .transform (coords )
6246
6245
6247
6246
self .add_collection (collection , autolim = False )
6248
6247
6249
- minx = np .min (x )
6250
- maxx = np .max (x )
6251
- miny = np .min (y )
6252
- maxy = np .max (y )
6248
+ minx , miny = np .min (coords , axis = 0 )
6249
+ maxx , maxy = np .max (coords , axis = 0 )
6253
6250
collection .sticky_edges .x [:] = [minx , maxx ]
6254
6251
collection .sticky_edges .y [:] = [miny , maxy ]
6255
- self .update_datalim (coords . reshape ( - 1 , 2 ) )
6252
+ self .update_datalim (coords )
6256
6253
self ._request_autoscale_view ()
6257
6254
return collection
6258
6255
0 commit comments