Skip to content

Fix FancyArrowPatch joinstyle #13647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down