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 5fc9822d5ff7..c19422772dec 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 @@ -6,16 +6,17 @@ The following modules are deprecated: the functionality can now be found in the python 3 standard library :mod:`subprocess`. -The following classes, methods, and functions are deprecated: +The following classes, methods, functions, and attributes are deprecated: +- ``Annotation.arrow``, - ``cbook.GetRealpathAndStat`` (which is only a helper for ``get_realpath_and_stat``), - ``cbook.Locked``, - ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead), - ``container.Container.set_remove_method``, +- ``font_manager.TempCache``, - ``mathtext.unichr_safe`` (use ``chr`` instead), - ``texmanager.dvipng_hack_alpha``, -- ``font_manager.TempCache``, The following rcParams are deprecated: - ``pgf.debug`` (the pgf backend relies on logging), diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 1740d765f1c3..6001b8d2f522 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -2051,8 +2051,6 @@ def __init__(self, s, xy, self.arrowprops = arrowprops - self.arrow = None - if arrowprops is not None: if "arrowstyle" in arrowprops: arrowprops = self.arrowprops.copy() @@ -2072,9 +2070,6 @@ def __init__(self, s, xy, def contains(self, event): contains, tinfo = Text.contains(self, event) - if self.arrow is not None: - in_arrow, _ = self.arrow.contains(event) - contains = contains or in_arrow if self.arrow_patch is not None: in_patch, _ = self.arrow_patch.contains(event) contains = contains or in_patch @@ -2098,9 +2093,6 @@ def anncoords(self, coords): self._textcoords = coords def set_figure(self, fig): - - if self.arrow is not None: - self.arrow.set_figure(fig) if self.arrow_patch is not None: self.arrow_patch.set_figure(fig) Artist.set_figure(self, fig) @@ -2257,18 +2249,19 @@ def get_window_extent(self, renderer=None): ''' if not self.get_visible(): return Bbox.unit() - arrow = self.arrow - arrow_patch = self.arrow_patch text_bbox = Text.get_window_extent(self, renderer=renderer) bboxes = [text_bbox] - if self.arrow is not None: - bboxes.append(arrow.get_window_extent(renderer=renderer)) - elif self.arrow_patch is not None: - bboxes.append(arrow_patch.get_window_extent(renderer=renderer)) + if self.arrow_patch is not None: + bboxes.append( + self.arrow_patch.get_window_extent(renderer=renderer)) return Bbox.union(bboxes) + arrow = property( + fget=cbook.deprecated("3.0")(lambda self: None), + fset=cbook.deprecated("3.0")(lambda self, value: None)) + docstring.interpd.update(Annotation=Annotation.__init__.__doc__)