diff --git a/doc/api/next_api_changes/deprecations/26780-AL.rst b/doc/api/next_api_changes/deprecations/26780-AL.rst new file mode 100644 index 000000000000..96cfdab93f55 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/26780-AL.rst @@ -0,0 +1,3 @@ +Support for passing the "frac" key in ``annotate(..., arrowprops={"frac": ...})`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... has been removed. This key has had no effect since Matplotlib 1.5. diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 4e377f48561f..09f89e09ef29 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1838,9 +1838,12 @@ def transform(renderer) -> Transform self._arrow_relpos = arrowprops.pop("relpos", (0.5, 0.5)) else: # modified YAArrow API to be used with FancyArrowPatch - for key in [ - 'width', 'headwidth', 'headlength', 'shrink', 'frac']: + for key in ['width', 'headwidth', 'headlength', 'shrink']: arrowprops.pop(key, None) + if 'frac' in arrowprops: + _api.warn_deprecated( + "3.8", name="the (unused) 'frac' key in 'arrowprops'") + arrowprops.pop("frac") self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), **arrowprops) else: self.arrow_patch = None @@ -1933,10 +1936,6 @@ def update_positions(self, renderer): shrink = arrowprops.get('shrink', 0.0) width = arrowprops.get('width', 4) headwidth = arrowprops.get('headwidth', 12) - if 'frac' in arrowprops: - _api.warn_external( - "'frac' option in 'arrowprops' is no longer supported;" - " use 'headlength' to set the head length in points.") headlength = arrowprops.get('headlength', 12) # NB: ms is in pts