diff --git a/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst b/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst index 16906cad9aa6..d8a60750c1d1 100644 --- a/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst +++ b/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst @@ -15,11 +15,13 @@ The following classes, methods, functions, and attributes are deprecated: - ``backend_wx.FigureCanvasWx.macros``, - ``cbook.GetRealpathAndStat``, ``cbook.Locked``, - ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead), - ``cbook.listFiles``, ``cbook.unicode_safe`` + ``cbook.listFiles``, ``cbook.unicode_safe``, - ``container.Container.set_remove_method``, +- ``contour.ContourLabeler.cl``, ``.cl_xy``, and ``.cl_cvalues``, - ``dates.DateFormatter.strftime_pre_1900``, ``dates.DateFormatter.strftime``, - ``font_manager.TempCache``, - ``mathtext.unichr_safe`` (use ``chr`` instead), +- ``table.Table.get_child_artists`` (use ``get_children`` instead), - ``testing.compare.ImageComparisonTest``, ``testing.compare.compare_float``, - ``testing.decorators.skip_if_command_unavailable``. - ``FigureCanvasQT.keyAutoRepeat`` (directly check diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 6e473671419e..e5d33022c3b4 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -215,16 +215,16 @@ def clabel(self, *args, **kwargs): else: self.labels(inline, inline_spacing) - # Hold on to some old attribute names. These are deprecated and will - # be removed in the near future (sometime after 2008-08-01), but - # keeping for now for backwards compatibility - self.cl = self.labelTexts - self.cl_xy = self.labelXYs - self.cl_cvalues = self.labelCValues - self.labelTextsList = cbook.silent_list('text.Text', self.labelTexts) return self.labelTextsList + cl = property(cbook.deprecated("3.0", alternative="labelTexts")( + lambda self: self.labelTexts)) + cl_xy = property(cbook.deprecated("3.0", alternative="labelXYs")( + lambda self: self.labelXYs)) + cl_cvalues = property(cbook.deprecated("3.0", alternative="labelCValues")( + lambda self: self.labelCValues)) + def print_label(self, linecontour, labelwidth): "Return *False* if contours are too short for a label." return (len(linecontour) > 10 * labelwidth diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index bb191ad330c0..94d05c9a7f85 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1306,7 +1306,6 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False, pyplot.subplots : pyplot API; docstring includes examples. """ - # for backwards compatibility if isinstance(sharex, bool): sharex = "all" if sharex else "none" if isinstance(sharey, bool): diff --git a/lib/matplotlib/table.py b/lib/matplotlib/table.py index 86a874a2d6cf..3c9f6215e0d9 100644 --- a/lib/matplotlib/table.py +++ b/lib/matplotlib/table.py @@ -21,13 +21,12 @@ """ import warnings -from . import artist +from . import artist, cbook, docstring from .artist import Artist, allow_rasterization from .patches import Rectangle -from matplotlib import docstring from .text import Text from .transforms import Bbox -from matplotlib.path import Path +from .path import Path class Cell(Rectangle): @@ -382,7 +381,7 @@ def contains(self, mouseevent): def get_children(self): """Return the Artists contained by the table.""" return list(self._cells.values()) - get_child_artists = get_children # backward compatibility + get_child_artists = cbook.deprecated("3.0")(get_children) def get_window_extent(self, renderer): """Return the bounding box of the table in window coords."""