Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/qt_editor/figureoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def prepare_data(d, init):
for label in imagelabels:
image = imagedict[label]
cmap = image.get_cmap()
if cmap not in cm.cmap_d:
if cmap not in cm.cmap_d.values():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be better to check that cmap.name not in cm.cmap_d?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought someone could accidentally create a custom cmap with the same name as one in cmap_d (although it's a pretty theoretical risk and it'd make the combobox awkward anyways), so checking on cmap identity should be safer.

cmaps = [(cmap, cmap.name)] + cmaps
imagedata = [
('Label', label),
Expand Down