Skip to content

Deprecate vestigial Annotation.arrow. #10818

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
Mar 18, 2018
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
5 changes: 3 additions & 2 deletions doc/api/next_api_changes/2018-02-15-AL-deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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),
21 changes: 7 additions & 14 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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__)