8000 Deprecate unused "frac" key in annotate() arrowprops. · matplotlib/matplotlib@f1eacc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1eacc3

Browse files
committed
Deprecate unused "frac" key in annotate() arrowprops.
This key has been unused for ~8y (197fc9f).
1 parent 449caf7 commit f1eacc3

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
@@ -1838,9 +1838,12 @@ def transform(renderer) -> Transform
18381838
self._arrow_relpos = arrowprops.pop("relpos", (0.5, 0.5))
18391839
else:
18401840
# modified YAArrow API to be used with FancyArrowPatch
1841-
for key in [
1842-
'width', 'headwidth', 'headlength', 'shrink', 'frac']:
1841+
for key in ['width', 'headwidth', 'headlength', 'shrink']:
18431842
arrowprops.pop(key, None)
1843+
if 'frac' in arrowprops:
1844+
_api.warn_deprecated(
1845+
"3.8", message="Support for passing the (unused) 'frac' key "
1846+
"has been removed %(since)s and will be removed %(removal)s.")
18441847
self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), **arrowprops)
18451848
else:
18461849
self.arrow_patch = None
@@ -1933,10 +1936,6 @@ def update_positions(self, renderer):
19331936
shrink = arrowprops.get('shrink', 0.0)
19341937
width = arrowprops.get('width', 4)
19351938
headwidth = arrowprops.get('headwidth', 12)
1936-
if 'frac' in arrowprops:
1937-
_api.warn_external(
1938-
"'frac' option in 'arrowprops' is no longer supported;"
1939-
" use 'headlength' to set the head length in points.")
19401939
headlength = arrowprops.get('headlength', 12)
19411940

19421941
# NB: ms is in pts

0 commit comments

Comments
 (0)
0