Skip to content

Commit 4841a02

Browse files
authored
Merge pull request #10818 from anntzer/vestigial-arrow
Deprecate vestigial Annotation.arrow.
2 parents e03b005 + d607ea5 commit 4841a02

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

doc/api/next_api_changes/2018-02-15-AL-deprecations.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ The following modules are deprecated:
66
the functionality can now be found in the python 3 standard library
77
:mod:`subprocess`.
88

9-
The following classes, methods, and functions are deprecated:
9+
The following classes, methods, functions, and attributes are deprecated:
1010

11+
- ``Annotation.arrow``,
1112
- ``cbook.GetRealpathAndStat`` (which is only a helper for
1213
``get_realpath_and_stat``),
1314
- ``cbook.Locked``,
1415
- ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead),
1516
- ``container.Container.set_remove_method``,
17+
- ``font_manager.TempCache``,
1618
- ``mathtext.unichr_safe`` (use ``chr`` instead),
1719
- ``texmanager.dvipng_hack_alpha``,
18-
- ``font_manager.TempCache``,
1920

2021
The following rcParams are deprecated:
2122
- ``pgf.debug`` (the pgf backend relies on logging),

lib/matplotlib/text.py

+7-14
Original file line numberDiff line numberDiff line change
@@ -2051,8 +2051,6 @@ def __init__(self, s, xy,
20512051

20522052
self.arrowprops = arrowprops
20532053

2054-
self.arrow = None
2055-
20562054
if arrowprops is not None:
20572055
if "arrowstyle" in arrowprops:
20582056
arrowprops = self.arrowprops.copy()
@@ -2072,9 +2070,6 @@ def __init__(self, s, xy,
20722070

20732071
def contains(self, event):
20742072
contains, tinfo = Text.contains(self, event)
2075-
if self.arrow is not None:
2076-
in_arrow, _ = self.arrow.contains(event)
2077-
contains = contains or in_arrow
20782073
if self.arrow_patch is not None:
20792074
in_patch, _ = self.arrow_patch.contains(event)
20802075
contains = contains or in_patch
@@ -2098,9 +2093,6 @@ def anncoords(self, coords):
20982093
self._textcoords = coords
20992094

21002095
def set_figure(self, fig):
2101-
2102-
if self.arrow is not None:
2103-
self.arrow.set_figure(fig)
21042096
if self.arrow_patch is not None:
21052097
self.arrow_patch.set_figure(fig)
21062098
Artist.set_figure(self, fig)
@@ -2257,18 +2249,19 @@ def get_window_extent(self, renderer=None):
22572249
'''
22582250
if not self.get_visible():
22592251
return Bbox.unit()
2260-
arrow = self.arrow
2261-
arrow_patch = self.arrow_patch
22622252

22632253
text_bbox = Text.get_window_extent(self, renderer=renderer)
22642254
bboxes = [text_bbox]
22652255

2266-
if self.arrow is not None:
2267-
bboxes.append(arrow.get_window_extent(renderer=renderer))
2268-
elif self.arrow_patch is not None:
2269-
bboxes.append(arrow_patch.get_window_extent(renderer=renderer))
2256+
if self.arrow_patch is not None:
2257+
bboxes.append(
2258+
self.arrow_patch.get_window_extent(renderer=renderer))
22702259

22712260
return Bbox.union(bboxes)
22722261

2262+
arrow = property(
2263+
fget=cbook.deprecated("3.0")(lambda self: None),
2264+
fset=cbook.deprecated("3.0")(lambda self, value: None))
2265+
22732266

22742267
docstring.interpd.update(Annotation=Annotation.__init__.__doc__)

0 commit comments

Comments
 (0)