Skip to content

[Bug]: Capstyle has no effect on FancyArrow #22340

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

Closed
mapfiable opened this issue Jan 28, 2022 · 5 comments
Closed

[Bug]: Capstyle has no effect on FancyArrow #22340

mapfiable opened this issue Jan 28, 2022 · 5 comments
Labels
status: needs clarification Issues that need more information to resolve.

Comments

@mapfiable
Copy link

Bug summary

I was trying to create a FancyArrow with a butt, but changing the capstyle has no effect. I guess this is related to #13641?

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrow


fig, ax = plt.subplots()
for i, cs in enumerate(['butt', 'round', 'projecting']):
    arrow = FancyArrow(0, 0+i, 1, 0, width=0.1, capstyle=cs)
    ax.add_patch(arrow)

ax.relim()
ax.autoscale_view()
fig.show()

Actual outcome

grafik

Expected outcome

Something similar to this:

grafik

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

pip

@jklymak
Copy link
Member

jklymak commented Jan 28, 2022

I'm confused - there are no caps in the arrow patches, so where would you expect those styles to have effect?

@jklymak jklymak added the status: needs clarification Issues that need more information to resolve. label Jan 28, 2022
@mapfiable
Copy link
Author

Ooh, ok. But then what is the non-pointy end of the arrow called? I thought that's the cap. But I guess in that case I missunderstood the kwarg. What is it supposed to do instead then / in what case does it have an effect? Also, does that mean I cannot get a FancyArrow with a round butt?

@jklymak
Copy link
Member

jklymak commented Jan 28, 2022

Fancy Arrow is a patch, and the lines outlining the patch are what have a cap style and join style. Those do not affect the shape of the patch. I don't see that FancyArrow allows different tail shapes, and the head shapes are restricted to width and length. So if you want a different shape, you will have to make a PolygonPatch and pass the path yourself.

@mapfiable
Copy link
Author

Ah, ok, I get it now, sorry. I also found this FancyArrow demo, but it never had anything to do with FancyArrows, did it? The new version doesn't mention FancyArrow anymore (except in the url), so I guess it only works for annotation arrows? If not, I guess it would be nice to have something like .-> defining an arrow with a round tail.

@jklymak
Copy link
Member

jklymak commented Jan 28, 2022

OK, lets close this, and if you would like to make a feature request, that would be great...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs clarification Issues that need more information to resolve.
Projects
None yet
Development

No branches or pull requests

2 participants