diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 9d23ffb87c88..3e4a77245698 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1764,27 +1764,23 @@ def transform(renderer) -> Transform xytext = self.xy x, y = xytext - Text.__init__(self, x, y, text, **kwargs) - self.arrowprops = arrowprops - if arrowprops is not None: + arrowprops = arrowprops.copy() if "arrowstyle" in arrowprops: - arrowprops = self.arrowprops.copy() self._arrow_relpos = arrowprops.pop("relpos", (0.5, 0.5)) else: # modified YAArrow API to be used with FancyArrowPatch - shapekeys = ('width', 'headwidth', 'headlength', - 'shrink', 'frac') - arrowprops = dict() - for key, val in self.arrowprops.items(): - if key not in shapekeys: - arrowprops[key] = val # basic Patch properties - self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), - **arrowprops) + for key in [ + 'width', 'headwidth', 'headlength', 'shrink', 'frac']: + arrowprops.pop(key, None) + self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), **arrowprops) else: self.arrow_patch = None + # Must come last, as some kwargs may be propagated to arrow_patch. + Text.__init__(self, x, y, text, **kwargs) + def contains(self, event): inside, info = self._default_contains(event) if inside is not None: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy