Closed
Description
Bug report
Bug summary
colormaps don't have getters for under, over, bad colors (although the corresponding setters exist).
I am writing a function that accepts a colormap as an argument. I want to ensure that the colormap passed to the function has the same color for the "bad" and "under" conditions. The only way around this is to access "private" attributes cmap._rgba_under
, cmap._rgba_bad
as shown below.
Code for reproduction
cmap = plt.get_cmap('cividis')
cmap.set_bad('k')
cmap.set_under('k')
assert cmap._rgba_bad == cmap._rgba_under
If adding getters (for under, over, bad colors) for the colormaps sounds like a good improvement, i would be interested in submitting a PR.
Actual outcome
# If applicable, paste the console output here
#
#
Expected outcome
Matplotlib version
- Operating system:
- Matplotlib version:
- Matplotlib backend (
print(matplotlib.get_backend())
): - Python version:
- Jupyter version (if applicable):
- Other libraries:
Metadata
Metadata
Assignees
Labels
No labels