@@ -5365,6 +5365,12 @@ def pcolor(self, *args, **kwargs):
5365
5365
snap : bool, optional, default: False
5366
5366
Whether to snap the mesh to pixel boundaries.
5367
5367
5368
+ dropdata: bool, default: True
5369
+ If True (default), and X and Y are the same size as C in their
5370
+ respective dimensions, drop the last element of C in both
5371
+ dimensions. If False, interpolate X and Y to their midpoints
5372
+ and extrapolate their endpoints.
5373
+
5368
5374
Returns
5369
5375
-------
5370
5376
collection : `matplotlib.collections.Collection`
@@ -5443,13 +5449,16 @@ def pcolor(self, *args, **kwargs):
5443
5449
if not self ._hold :
5444
5450
self .cla ()
5445
5451
5452
+ dropdata = kwargs .pop ('dropdata' , True )
5453
+
5446
5454
alpha = kwargs .pop ('alpha' , None )
5447
5455
norm = kwargs .pop ('norm' , None )
5448
5456
cmap = kwargs .pop ('cmap' , None )
5449
5457
vmin = kwargs .pop ('vmin' , None )
5450
5458
vmax = kwargs .pop ('vmax' , None )
5451
5459
5452
- X , Y , C = self ._pcolorargs ('pcolor' , * args , allmatch = False )
5460
+ X , Y , C = self ._pcolorargs ('pcolor' , * args ,
5461
+ allmatch = False , dropdata = dropdata )
5453
5462
Ny , Nx = X .shape
5454
5463
5455
5464
# unit conversion allows e.g. datetime objects as axis values
@@ -5620,6 +5629,12 @@ def pcolormesh(self, *args, **kwargs):
5620
5629
*alpha*: ``0 <= scalar <= 1`` or *None*
5621
5630
the alpha blending value
5622
5631
5632
+ *dropdata*: boolean
5633
+ if True (default), and X and Y are the same size as C in their
5634
+ respective dimensions, drop the last element of C in both
5635
+ dimensions. If False, interpolate X and Y to their
5636
+ midpoints and extrapolate their endpoints.
5637
+
5623
5638
Return value is a :class:`matplotlib.collections.QuadMesh`
5624
5639
object.
5625
5640
@@ -5638,6 +5653,7 @@ def pcolormesh(self, *args, **kwargs):
5638
5653
if not self ._hold :
5639
5654
self .cla ()
5640
5655
5656
+ dropdata = kwargs .pop ('dropdata' , True )
5641
5657
alpha = kwargs .pop ('alpha' , None )
5642
5658
norm = kwargs .pop ('norm' , None )
5643
5659
cmap = kwargs .pop ('cmap' , None )
@@ -5649,7 +5665,8 @@ def pcolormesh(self, *args, **kwargs):
5649
5665
5650
5666
allmatch = (shading == 'gouraud' )
5651
5667
5652
- X , Y , C = self ._pcolorargs ('pcolormesh' , * args , allmatch = allmatch )
5668
+ X , Y , C = self ._pcolorargs ('pcolormesh' , * args ,
5669
+ allmatch = allmatch , dropdata = dropdata )
5653
5670
Ny , Nx = X .shape
5654
5671
X = X .ravel ()
5655
5672
Y = Y .ravel ()
0 commit comments