FIX: Deprecate using clabel() with filled contours#31347
Draft
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Draft
FIX: Deprecate using clabel() with filled contours#31347timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Conversation
3b2af05 to
a5b4b7f
Compare
rcomer
reviewed
Mar 22, 2026
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Using `~.Axes.clabel` to label filled contours created with `~.Axes.contourf` is deprecated. ``clabel()`` | ||
| is designed to label contour lines (`.Axes.coutour`), and using it with filled contours can lead to inconsistent |
Member
There was a problem hiding this comment.
Suggested change
| is designed to label contour lines (`.Axes.coutour`), and using it with filled contours can lead to inconsistent | |
| is designed to label contour lines (`.Axes.contour`), and using it with filled contours can lead to inconsistent |
| is designed to label contour lines (`.Axes.coutour`), and using it with filled contours can lead to inconsistent | ||
| plots. If you want to add labels to filled contours, the recommended approach is to first create the filled contours | ||
| with `~.Axes.contourf`, then overlay contour lines using `~.Axes.contour`, and finally apply `~.Axes.clabel` to those | ||
| contour lines for labeling. |
Member
There was a problem hiding this comment.
Maybe add a link to the contour demo that shows this being done?
It's never been intended to be used that way and may cause inconsistent plots. Closes matplotlib#31344.
a5b4b7f to
46baee2
Compare
Member
Author
|
Still need to fix test failures. |
Member
|
Should there also be a deprecated directive on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's never been intended to be used that way and may cause inconsistent plots. Closes #31344.