8000 revert original default · matplotlib/matplotlib@8849cfb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8849cfb

Browse files
committed
revert original default
1 parent 3ba5c4c commit 8849cfb

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5365,6 +5365,12 @@ def pcolor(self, *args, **kwargs):
53655365
snap : bool, optional, default: False
53665366
Whether to snap the mesh to pixel boundaries.
53675367
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+
53685374
Returns
53695375
-------
53705376
collection : `matplotlib.collections.Collection`
@@ -5443,13 +5449,16 @@ def pcolor(self, *args, **kwargs):
54435449
if not self._hold:
54445450
self.cla()
54455451

5452+
dropdata = kwargs.pop('dropdata', True)
5453+
54465454
alpha = kwargs.pop('alpha', None)
54475455
norm = kwargs.pop('norm', None)
54485456
cmap = kwargs.pop('cmap', None)
54495457
vmin = kwargs.pop('vmin', None)
54505458
vmax = kwargs.pop('vmax', None)
54515459

5452-
X, Y, C = self._pcolorargs('pcolor', *args, allmatch=False)
5460+
X, Y, C = self._pcolorargs('pcolor', *args,
5461+
allmatch=False, dropdata=dropdata)
54535462
Ny, Nx = X.shape
54545463

54555464
# unit conversion allows e.g. datetime objects as axis values
@@ -5620,6 +5629,12 @@ def pcolormesh(self, *args, **kwargs):
56205629
*alpha*: ``0 <= scalar <= 1`` or *None*
56215630
the alpha blending value
56225631
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+
56235638
Return value is a :class:`matplotlib.collections.QuadMesh`
56245639
object.
56255640
@@ -5638,6 +5653,7 @@ def pcolormesh(self, *args, **kwargs):
56385653
if not self._hold:
56395654
self.cla()
56405655

5656+
dropdata = kwargs.pop('dropdata', True)
56415657
alpha = kwargs.pop('alpha', None)
56425658
norm = kwargs.pop('norm', None)
56435659
cmap = kwargs.pop('cmap', None)
@@ -5649,7 +5665,8 @@ def pcolormesh(self, *args, **kwargs):
56495665

56505666
allmatch = (shading == 'gouraud')
56515667

5652-
X, Y, C = self._pcolorargs('pcolormesh', *args, allmatch=allmatch)
5668+
X, Y, C = self._pcolorargs('pcolormesh', *args,
5669+
allmatch=allmatch, dropdata=dropdata)
56535670
Ny, Nx = X.shape
56545671
X = X.ravel()
56555672
Y = Y.ravel()

0 commit comments

Comments
 (0)
0