Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix rectangle and hatches for colorbar#23684

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:mainfromoscargus:colorbarhatchrectangle
Oct 6, 2022

Conversation

oscargus
Copy link
Member

@oscargusoscargus commentedAug 20, 2022
edited
Loading

PR Summary

Closes#23456.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

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

jklymak
jklymak previously requested changesAug 20, 2022
Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

This fix seems correct to fix the shape bug. However, I'll block because It seems better to just leave hatching completely broken, for the horizontal case at least, rather than fix it for a 3.6 with an off-by-one bug? I appreciate the off-by-one bug is in the semi-working vertical colorbar as well, and agree that they both need to be fixed. If anything, I'd remove the hatching completely from the colorbar for 3.6 until there is a proper fix.

oscargus reacted with thumbs up emoji
@jklymak
Copy link
Member

As per comment in the original issue if this fixes cbars without extends then I withdraw my objection. Obviously we should fix the extends but this is an improvement. I'd add a test with no extends
For now.

@jklymakjklymak dismissed theirstale reviewAugust 20, 2022 19:36

Problem just with extends. This fixes non extend cbars properly

@oscargus
Copy link
MemberAuthor

I've fixed the extends as well now.

def test_colorbar_contourf_extend_patches():
params = [
('both', 5, ['\\', '//']),
('min', 7, ['+']),
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This may seem stupid, but this did actually break at one stage as hatches wasn't extended enough.

cs = ax.contourf(x, y, z, levels, hatches=hatches,
cmap=cmap, extend=extend)
fig.colorbar(cs, ax=ax, orientation=orientation, fraction=0.4,
extendfrac=0.2, aspect=5)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

"Oversized" colorbar so that hatches are visible.

@oscargusoscargus changed the titleFix rectangle for horizontal colorbar with hatchesFix rectangle and hatches for colorbarAug 20, 2022
@oscargusoscargus added this to thev3.7.0 milestoneAug 30, 2022
@jklymakjklymak modified the milestones:v3.7.0,v3.6.1Sep 8, 2022
@jklymak
Copy link
Member

Moved to 3.6.1 since this is a bug fix, even if its an old bug?

@oscargus
Copy link
MemberAuthor

I'll try to update this over the weekend. Had forgotten about the comments...

@QuLogicQuLogic merged commit60d3d29 intomatplotlib:mainOct 6, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 6, 2022
QuLogic added a commit that referenced this pull requestOct 6, 2022
…684-on-v3.6.xBackport PR#23684 on branch v3.6.x (Fix rectangle and hatches for colorbar)
@oscargusoscargus deleted the colorbarhatchrectangle branchOctober 6, 2022 10:40
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.1
Development

Successfully merging this pull request may close these issues.

[Bug]: Horizontal colorbars drawn incorrectly with hatches
3 participants
@oscargus@jklymak@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp