fix: use last/first colour for over/under when extend=None - #244
Open
mercael91 wants to merge 7 commits into
Open
fix: use last/first colour for over/under when extend=None#244mercael91 wants to merge 7 commits into
mercael91 wants to merge 7 commits into
Conversation
…ections (ecmwf#232) * Adds transform_first='auto' option * Adds image test to ensure regridding on non-cylindrical projections works * Updates regridding docs to use pcolormesh, to show the regridding process more visibly
…rough the colormap handling (ecmwf#236)
* Tweaks to default zorders * Undo log level changes; committed to wrong branch * Increase zorders to be 2 by default
* Handle ListedColormaps in expand and cmap_and_norm * Copy definition of colors from expand to cmap_and_norm
When and , the over and under colours were set to transparent . This caused a value exactly equal to to render transparent instead of using the last colour in the map. Matplotlib's default behaviour is to fall back to the last colour for the over-range. Align earthkit-plots with that by defaulting to and to . Fixes ecmwf#243
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.
Summary
When
extend_levels=Falseandextend=None, the over and under colours were set to transparent(0, 0, 0, 0). This caused a value exactly equal tolevels[-1]to render transparent instead of using the last colour in the map.Matplotlib's default
Colormapbehaviour is to fall back to the last colour for the over-range. This PR aligns earthkit-plots with that by defaultingover_colortocolors[-1]andunder_colortocolors[0].Change
Verification
levels[-1]now renders with the last colour instead of transparentlevels[0]continues to render with the first colourextend="both",extend="max",extend="min"is unchangedFixes #243