-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Change colorbar for contour to have the proper axes limits... #13506
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc51a68
ENH: make contour colorbars behave like other colorbars
jklymak 299dffa
TST: add some tests
jklymak 5d38b37
DOC: API note
jklymak 819071b
FIX: allow uniform colorbar for contours
jklymak 2c25486
FIX: allow uniform colorbar for contours
jklymak 7b3ea96
FIX: allow uniform colorbar for contours
jklymak 6d7c885
TST: add test for uneven contour colorbar
jklymak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
`matplotlib.colorbar.Colorbar` uses un-normalized axes for all mappables | ||
------------------------------------------------------------------------ | ||
|
||
Before 3.0, `matplotlib.colorbar.Colorbar` (`~.Figure.colorbar`) normalized | ||
all axes limits between 0 and 1 and had custom tickers to handle the | ||
labelling of the colorbar ticks. After 3.0, colorbars constructed from | ||
mappables that were *not* contours were constructed with axes that had | ||
limits between ``vmin`` and ``vmax`` of the mappable's norm, and the tickers | ||
were made children of the normal axes tickers. | ||
|
||
This version of Matplotlib extends that to mappables made by contours, and | ||
allows the axes to run between the lowest boundary in the contour and the | ||
highest. | ||
|
||
Code that worked around the normalization between 0 and 1 will need to be | ||
modified. |
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
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
Binary file modified
BIN
+6 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_contour/contour_log_extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can that be left out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want the axes to be logarithmic in this case, but I agree its open to interpretation:
With this change:
Without this change:
Before this PR:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks reasonable.