Skip to content

FIX: contourf hatches use multiple edgecolors #28993

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
Oct 21, 2024

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Oct 19, 2024

PR summary

Fixes #28990. I think it would be good to get this minor fix in for v3.10 since the example from the issue will otherwise not be possible to plot (and it is possible at v3.9 using the deprecated collections attribute).

I note that passing edgecolors to contourf results in a warning that the parameter is ignored. This seems inconsistent with being able to set them after ContourSet instantiation. However, I propose to ignore the inconsistency for now and think about it later when a release is not imminent.

PR checklist

@rcomer rcomer added topic: contour PR: bugfix Pull requests that fix identified bugs labels Oct 19, 2024
@rcomer rcomer added this to the v3.10.0 milestone Oct 19, 2024
@@ -1259,12 +1259,16 @@ def draw(self, renderer):
super().draw(renderer)
return
# In presence of hatching, draw contours one at a time.
all_edgecolors = self.get_edgecolors()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
all_edgecolors = self.get_edgecolors()
edgecolors = self.get_edgecolors()

Slight preference for leaving out the all_ prefix. It does not convey information.

@rcomer rcomer force-pushed the contour-hatch-colors branch from cde45c4 to 08e6552 Compare October 19, 2024 19:19
@timhoffm timhoffm modified the milestones: v3.10.0, v3.9.3 Oct 20, 2024
@timhoffm
Copy link
Member

If possible, let's also backport to 3.9 to have a version that supports both the old and new syntax and thus have a smoother transition.

@ksunden ksunden merged commit 190aa67 into matplotlib:main Oct 21, 2024
43 checks passed
Copy link

lumberbot-app bot commented Oct 21, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.9.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 190aa679c584af915c3ad24f8b3e06fe6305bf2f
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #28993: FIX: contourf hatches use multiple edgecolors'
  1. Push to a named branch:
git push YOURFORK v3.9.x:auto-backport-of-pr-28993-on-v3.9.x
  1. Create a PR against branch v3.9.x, I would have named this PR:

"Backport PR #28993 on branch v3.9.x (FIX: contourf hatches use multiple edgecolors)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@rcomer rcomer deleted the contour-hatch-colors branch October 21, 2024 21:15
QuLogic pushed a commit to QuLogic/matplotlib that referenced this pull request Oct 22, 2024
timhoffm added a commit that referenced this pull request Oct 22, 2024
…3.9.x

Backport PR #28993 on branch v3.9.x (FIX: contourf hatches use multiple edgecolors)
@rcomer rcomer restored the contour-hatch-colors branch November 11, 2024 19:55
@rcomer rcomer deleted the contour-hatch-colors branch November 11, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bugfix Pull requests that fix identified bugs topic: contour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: no longer able to set multiple hatch colors
5 participants