8000 Remove deprecated "shading" option to pcolor. by anntzer · Pull Request #7475 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove deprecated "shading" option to pcolor. #7475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/api/api_changes/code_removal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ removed.

Support for setting an ``Axes``' aspect to ``"normal"`` has been removed, in
favor of the synonym ``"auto"``.


``shading`` kwarg to ``pcolor``
-------------------------------

The ``shading`` kwarg to ``pcolor`` has been removed. Set ``edgecolors``
appropriately instead.
21 changes: 1 addition & 20 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5293,15 +5293,6 @@ def pcolor(self, *args, **kwargs):
*vmax* passed in here override any pre-existing values
supplied in the *norm* instance.

*shading*: [ 'flat' | 'faceted' ]
If 'faceted', a black grid is drawn around each rectangle; if
'flat', edges are not drawn. Default is 'flat', contrary to
MATLAB.

This kwarg is deprecated; please use 'edgecolors' instead:
* shading='flat' -- edgecolors='none'
* shading='faceted -- edgecolors='k'

*edgecolors*: [ *None* | ``'none'`` | color | color sequence]
If *None*, the rc setting is used by default.

Expand Down Expand Up @@ -5391,11 +5382,6 @@ def pcolor(self, *args, **kwargs):
cmap = kwargs.pop('cmap', None)
vmin = kwargs.pop('vmin', None)
vmax = kwargs.pop('vmax', None)
if 'shading' in kwargs:
cbook.warn_deprecated(
'1.2', name='shading', alternative='edgecolors',
obj_type='option')
shading = kwargs.pop('shading', 'flat')

X, Y, C = self._pcolorargs('pcolor', *args, allmatch=False)
Ny, Nx = X.shape
Expand Down Expand Up @@ -5445,14 +5431,9 @@ def pcolor(self, *args, **kwargs):
kwargs['linewidths'] = kwargs.pop('linewidth')
kwargs.setdefault('linewidths', linewidths)

if shading == 'faceted':
edgecolors = 'k',
else:
edgecolors = 'none'

if 'edgecolor' in kwargs:
kwargs['edgecolors'] = kwargs.pop('edgecolor')
ec = kwargs.setdefault('edgecolors', edgecolors)
ec = kwargs.setdefault('edgecolors', 'none')

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