From 4e6d8df85f8b38a29f612bae9912cffb36331a16 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 16 Nov 2016 21:59:23 -0800 Subject: [PATCH] Remove deprecated "shading" option to pcolor. It has been deprecated since 1.2. --- doc/api/api_changes/code_removal.rst | 7 +++++++ lib/matplotlib/axes/_axes.py | 21 +-------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/doc/api/api_changes/code_removal.rst b/doc/api/api_changes/code_removal.rst index bed0560a353e..d2fbff912de0 100644 --- a/doc/api/api_changes/code_removal.rst +++ b/doc/api/api_changes/code_removal.rst @@ -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. diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index c4f05f85df94..0eaf5cc53467 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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. @@ -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 @@ -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