You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When selecting a colormap, I often find myself not using the proper capitalization. For example, I may reference "spectral" when it should be "Spectral" or I may reference "Seismic" when it should be "seismic" (official colormap examples). Could we do some fix that allows any case to work?
Proposed fix
Perhaps I'm just missing the logic behind why some are capitalized whereas others are not, but could we just define duplicate versions of the colormap either a capitalized first letter or a lowercase first letter? Something like this could be as simple as adding plt.cm.spectral = plt.cm.Spectral and the like wherever the colormaps are defined? If someone knows a better solution that doesn't require doing this for all the named colormaps, that would be better. I presume there's no easy way to just do it with .lower() or so.
The text was updated successfully, but these errors were encountered:
I feel making colormap names case insensitve in general is too permissive.
Most colormap names are all-lowercase, which seems fine.
The color-combination maps like "RdBu" use capitalization to distinguish the parts "rdbu" would be less readable.
Outliers are "Wistia", "Spectral", "CMRmap" and some qualitative colormaps.
could we just define duplicate versions of the colormap either a capitalized first letter or a lowercase first letter? Something like this could be as simple as adding plt.cm.spectral = plt.cm.Spectral and the like wherever the colormaps are defined?
It's not that simple, because of cmap = plt.cm.spectral; cmap.name == "Spectral". This would add confusion on another level. We'd have to add a copy with the new name. But then you get also all the duplicates in the listings. Note also that there's the plt.cm.[name] as well as the colormap registry plt.colormaps the latter could do aliasing on lookup but that's another level of complexity.
I think, it's best to live with the inconsistency.
Fair enough, I wasn't aware of this "Note also that there's the plt.cm.[name] as well as the colormap registry plt.colormaps...". Thanks anyways for reading my suggestion
Summary
When selecting a colormap, I often find myself not using the proper capitalization. For example, I may reference "spectral" when it should be "Spectral" or I may reference "Seismic" when it should be "seismic" (official colormap examples). Could we do some fix that allows any case to work?
Proposed fix
Perhaps I'm just missing the logic behind why some are capitalized whereas others are not, but could we just define duplicate versions of the colormap either a capitalized first letter or a lowercase first letter? Something like this could be as simple as adding
plt.cm.spectral = plt.cm.Spectral
and the like wherever the colormaps are defined? If someone knows a better solution that doesn't require doing this for all the named colormaps, that would be better. I presume there's no easy way to just do it with.lower()
or so.The text was updated successfully, but these errors were encountered: