8000 Merge pull request #26080 from anntzer/af · matplotlib/matplotlib@3b7845a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b7845a

Browse files
authored
Merge pull request #26080 from anntzer/af
Deprecate unused "frac" key in annotate() arrowprops.
2 parents 053e529 + df70cf3 commit 3b7845a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Support for passing the "frac" key in ``annotate(..., arrowprops={"frac": ...})``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... has been removed. This key has had no effect since Matplotlib 1.5.

lib/matplotlib/text.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,9 +1837,12 @@ def transform(renderer) -> Transform
18371837
self._arrow_relpos = arrowprops.pop("relpos", (0.5, 0.5))
18381838
else:
18391839
# modified YAArrow API to be used with FancyArrowPatch
1840-
for key in [
1841-
'width', 'headwidth', 'headlength', 'shrink', 'frac']:
1840+
for key in ['width', 'headwidth', 'headlength', 'shrink']:
18421841
arrowprops.pop(key, None)
1842+
if 'frac' in arrowprops:
1843+
_api.warn_deprecated(
1844+
"3.8", name="the (unused) 'frac' key in 'arrowprops'")
1845+
arrowprops.pop("frac")
18431846
self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), **arrowprops)
18441847
else:
18451848
self.arrow_patch = None
@@ -1932,10 +1935,6 @@ def update_positions(self, renderer):
19321935
shrink = arrowprops.get('shrink', 0.0)
19331936
width = arrowprops.get('width', 4)
19341937
headwidth = arrowprops.get('headwidth', 12)
1935-
if 'frac' in arrowprops:
1936-
_api.warn_external(
1937-
"'frac' option in 'arrowprops' is no longer supported;"
1938-
" use 'headlength' to set the head length in points.")
19391938
headlength = arrowprops.get('headlength', 12)
19401939

19411940
# NB: ms is in pts

0 commit comments

Comments
 (0)
0