Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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" attributescmap._rgba_under
,cmap._rgba_bad
as shown below.
Code for reproduction
cmap=plt.get_cmap('cividis')cmap.set_bad('k')cmap.set_under('k')assertcmap._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