diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 9395e136f5ea..ac86eebc9bc3 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -4020,6 +4020,9 @@ def __init__(self, posA=None, posB=None, ----- Valid kwargs are: %(Patch)s + + In contrast to other patches, the default ``capstyle`` and + ``joinstyle`` for `FancyArrowPatch` are set to ``"round"``. """ if arrow_transmuter is not None: cbook.warn_deprecated( @@ -4035,6 +4038,10 @@ def __init__(self, posA=None, posB=None, ' and will be removed in Matplotlib 3.1'), name='connector', obj_type='keyword argument') + # Traditionally, the cap- and joinstyle for FancyArrowPatch are round + kwargs.setdefault("joinstyle", "round") + kwargs.setdefault("capstyle", "round") + Patch.__init__(self, **kwargs) if posA is not None and posB is not None and path is None: @@ -4284,9 +4291,7 @@ def draw(self, renderer): if not self.get_visible(): return - # FancyArrowPatch has traditionally forced the capstyle and joinstyle. - with cbook._setattr_cm(self, _capstyle='round', _joinstyle='round'), \ - self._bind_draw_path_function(renderer) as draw_path: + with self._bind_draw_path_function(renderer) as draw_path: # FIXME : dpi_cor is for the dpi-dependency of the linewidth. There # could be room for improvement.