You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
joinstyle is not respected for FancyArrowPatch (either the path or the arrow heads) #13641
joinstyle is not respected for FancyArrowPatch (either the path or the arrow heads)
Code for reproduction
importmatplotlibasmplimportmatplotlib.pyplotasplt# high dpi so you can see the differencefig, ax=plt.subplots(dpi=600)
# iterate through stylesfori, jsinenumerate(("miter", "round", "bevel"), start=1):
arrow_head=mpl.patches.ArrowStyle.CurveFilledAB(head_length=4, head_width=2)
connection=mpl.patches.ConnectionStyle.Bar(fraction=0, angle=-90)
double_arrow=mpl.patches.FancyArrowPatch((0.1*i, 1-0.1), (1-0.1, 0.1*i), linewidth=2,
arrowstyle=arrow_head, connectionstyle=connection, joinstyle=js)
ax.add_patch(double_arrow)
Actual outcome
Expected outcome
Different join styles for each line (including arrow heads)
Python 3.7.2 (default, Feb 21 2019, 17:35:59) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
Yes, ignoring the capstyle was probably a long-standing bug [..] but changing that would result in changes in the baseline images [..]. I'll leave this as it is until someone actually complains or we have some othe reason to change the baseline images.
Actually, I don't quite see why we can't keep "round" as default - in that way no baseline images need to change and it remains backwards compatible - but at the same time allow for user input to change it.
Activity
ImportanceOfBeingErnest commentedon Mar 10, 2019
The joinstyle and capstyle are fixed for
FancyArrowPatch.matplotlib/lib/matplotlib/patches.py
Lines 4287 to 4289 in 21f1355
I don't know why that is the case. If we remove that line the result would look like this:
Is that what you're expecting? Would someone know why that got fixed in the first place?
ImportanceOfBeingErnest commentedon Mar 10, 2019
Ok, here is the deal (in a comment by @anntzer):
Actually, I don't quite see why we can't keep
"round"as default - in that way no baseline images need to change and it remains backwards compatible - but at the same time allow for user input to change it.ImportanceOfBeingErnest commentedon Mar 10, 2019
A possible fix is at #13647, no changes are made to the defaults and tests pass as they are.