Skip to content

fix: fill stairs should have lw=0 instead of edgecolor="none" #22559

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 1 commit into from
Mar 3, 2022

Conversation

andrzejnovak
Copy link
Contributor

PR Summary

@jrueb has reported that calling set_color() on existing stairs() that had fill changed the drawn object size. This is because currently for fill=True stairs the edge is "hidden" by setting edgecolor="none", which set_color() overrides. This is not transparent. This PR changes the handling to instead set the edge linewidth to 0. Test is included.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me. Just to check, the test you've added failed before this change?

@dstansby dstansby added this to the v3.5.2 milestone Feb 26, 2022
@andrzejnovak
Copy link
Contributor Author

@dstansby Yes, the new test fails without this PR

@tacaswell
Copy link
Member

👍🏻 to the change, I think this will lead to less surprise in multiple places (both the issue reported here and people passing linewidth and not understanding why it has not effect under the old scheme).

I think this needs an API change note and should not be backported. I can be talked out of that position.

@andrzejnovak
Copy link
Contributor Author

@tacaswell Feels like a bugfix, the outward-facing interface is not changed, but I can add the change of behaviour w.r.t linewidth if desired

@tacaswell tacaswell merged commit 4a3c5d6 into matplotlib:main Mar 3, 2022
@tacaswell
Copy link
Member

Thank you @andrzejnovak !!

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 3, 2022
QuLogic added a commit that referenced this pull request Mar 4, 2022
…559-on-v3.5.x

Backport PR #22559 on branch v3.5.x (fix: fill stairs should have lw=0 instead of edgecolor="none")
@QuLogic
Copy link
Member

QuLogic commented Mar 4, 2022

Bug fix releases don't get What's new pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants