Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 77cdbe8

Browse filesBrowse files
fix fancyarrowpatch-joinstyle
1 parent 21f1355 commit 77cdbe8
Copy full SHA for 77cdbe8

File tree

Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,6 +4020,9 @@ def __init__(self, posA=None, posB=None,
40204020
-----
40214021
Valid kwargs are:
40224022
%(Patch)s
4023+
4024+
In contrast to other patches, the default ``capstyle`` and
4025+
``joinstyle`` for `FancyArrowPatch` are set to ``"round"``.
40234026
"""
40244027
if arrow_transmuter is not None:
40254028
cbook.warn_deprecated(
@@ -4035,6 +4038,10 @@ def __init__(self, posA=None, posB=None,
40354038
' and will be removed in Matplotlib 3.1'),
40364039
name='connector',
40374040
obj_type='keyword argument')
4041+
# Traditionally, the cap- and joinstyle for FancyArrowPatch are round
4042+
kwargs.setdefault("joinstyle", "round")
4043+
kwargs.setdefault("capstyle", "round")
4044+
40384045
Patch.__init__(self, **kwargs)
40394046

40404047
if posA is not None and posB is not None and path is None:
@@ -4284,9 +4291,7 @@ def draw(self, renderer):
42844291
if not self.get_visible():
42854292
return
42864293

4287-
# FancyArrowPatch has traditionally forced the capstyle and joinstyle.
4288-
with cbook._setattr_cm(self, _capstyle='round', _joinstyle='round'), \
4289-
self._bind_draw_path_function(renderer) as draw_path:
4294+
with self._bind_draw_path_function(renderer) as draw_path:
42904295

42914296
# FIXME : dpi_cor is for the dpi-dependency of the linewidth. There
42924297
# could be room for improvement.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.