Skip to content

Commit d36e499

Browse files
authored
Merge pull request #7475 from anntzer/pcolor-shading
MNT: Remove deprecated "shading" option to pcolor.
2 parents f06644d + 4e6d8df commit d36e499

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

doc/api/api_changes/code_removal.rst

+7
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ removed.
2525

2626
Support for setting an ``Axes``' aspect to ``"normal"`` has been removed, in
2727
favor of the synonym ``"auto"``.
28+
29+
30+
``shading`` kwarg to ``pcolor``
31+
-------------------------------
32+
33+
The ``shading`` kwarg to ``pcolor`` has been removed. Set ``edgecolors``
34+
appropriately instead.

lib/matplotlib/axes/_axes.py

+1-20
Original file line numberDiff line numberDiff line change
@@ -5297,15 +5297,6 @@ def pcolor(self, *args, **kwargs):
52975297
*vmax* passed in here override any pre-existing values
52985298
supplied in the *norm* instance.
52995299
5300-
*shading*: [ 'flat' | 'faceted' ]
5301-
If 'faceted', a black grid is drawn around each rectangle; if
5302-
'flat', edges are not drawn. Default is 'flat', contrary to
5303-
MATLAB.
5304-
5305-
This kwarg is deprecated; please use 'edgecolors' instead:
5306-
* shading='flat' -- edgecolors='none'
5307-
* shading='faceted -- edgecolors='k'
5308-
53095300
*edgecolors*: [ *None* | ``'none'`` | color | color sequence]
53105301
If *None*, the rc setting is used by default.
53115302
@@ -5395,11 +5386,6 @@ def pcolor(self, *args, **kwargs):
53955386
cmap = kwargs.pop('cmap', None)
53965387
vmin = kwargs.pop('vmin', None)
53975388
vmax = kwargs.pop('vmax', None)
5398-
if 'shading' in kwargs:
5399-
cbook.warn_deprecated(
5400-
'1.2', name='shading', alternative='edgecolors',
5401-
obj_type='option')
5402-
shading = kwargs.pop('shading', 'flat')
54035389

54045390
X, Y, C = self._pcolorargs('pcolor', *args, allmatch=False)
54055391
Ny, Nx = X.shape
@@ -5449,14 +5435,9 @@ def pcolor(self, *args, **kwargs):
54495435
kwargs['linewidths'] = kwargs.pop('linewidth')
54505436
kwargs.setdefault('linewidths', linewidths)
54515437

5452-
if shading == 'faceted':
5453-
edgecolors = 'k',
5454-
else:
5455-
edgecolors = 'none'
5456-
54575438
if 'edgecolor' in kwargs:
54585439
kwargs['edgecolors'] = kwargs.pop('edgecolor')
5459-
ec = kwargs.setdefault('edgecolors', edgecolors)
5440+
ec = kwargs.setdefault('edgecolors', 'none')
54605441

54615442
# aa setting will default via collections to patch.antialiased
54625443
# unless the boundary is not stroked, in which case the

0 commit comments

Comments
 (0)