forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add bad, under, over kwargs to Colormap
This is part of the effort for making Colormaps immutable (matplotlib#29141). Obviously, we can only get immutable in the future if the bad, under, over colors can already be set upon creation.
- Loading branch information
Showing
6 changed files
with
180 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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,23 @@ | ||
Colormaps support giving colors for bad, under and over values on creation | ||
-------------------------------------------------------------------------- | ||
|
||
Colormaps gained keyword arguments ``bad``, ``under``, and ``over`` to | ||
specify these values on creation. Previously, these values would have to | ||
be set afterwards using one of `~.Colormap.set_bad`, `~.Colormap.set_under`, | ||
`~.Colormap.set_bad`, `~.Colormap.set_extremes`, `~.Colormap.with_extremes`. | ||
|
||
It is recommended to use the new functionality, e.g.:: | ||
|
||
cmap = ListedColormap(colors, bad="red", under="darkblue", over="purple") | ||
|
||
instead of:: | ||
|
||
cmap = ListedColormap(colors).with_extremes( | ||
bad="red", under="darkblue", over="purple") | ||
|
||
or:: | ||
|
||
cmap = ListedColormap(colors) | ||
cmap.set_bad("red") | ||
cmap.set_under("darkblue") | ||
cmap.set_over("purple") |
This file contains 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 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 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 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 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