Skip to content

Line2D and PathPatch have different defaults for capstyle and joinstyle #18597

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

Open
timhoffm opened this issue Sep 27, 2020 · 3 comments
Open
Labels
API: consistency keep Items to be ignored by the “Stale” Github Action Maintenance

Comments

@timhoffm
Copy link
Member

timhoffm commented Sep 27, 2020

Describe the issue

Noticed while working on #18579.

Summary

Capstyle and joinstyle of PathPatch and Line2D differ:

c apstyle joinstyle
Line2D projecting round
PathPatch butt miter

as can be seen in:

import matplotlib.pyplot as plt
from matplotlib.patches import Path, PathPatch
x = [0, 5, 0]
y = [0, 0, 2]

ax = plt.gca()
ax.axis('equal')
ax.set_xlim(-1, 7)
ax.plot(x, y, lw=20, alpha=0.5, label='Line2D')
ax.add_patch(PathPatch(Path(list(zip(x, y))), fill=False, ec='r', lw=20, label='PathPatch', capstyle='butt'))
ax.legend()

grafik

Proposed fix

This is unexpected and must at least be documented.

I'm unsure if we can afford to change the default of PathPatch (if we make a breaking change, it must be on PathPatch, Line2D is too often used and we cannot affort to change that.

Opinions welcome.

@dopplershift
Copy link
Contributor

I'd be in favor of changing PathPatch.

@anntzer
Copy link
Contributor

anntzer commented Sep 28, 2020

See also #11741, #13647.

@timhoffm timhoffm changed the title Line2D and PathPatch have different defaults for capstyle and drawstyle Line2D and PathPatch have different defaults for capstyle and joinstyle Dec 16, 2021
@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Aug 23, 2023
@anntzer anntzer added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: consistency keep Items to be ignored by the “Stale” Github Action Maintenance
Projects
None yet
Development

No branches or pull requests

3 participants