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
This is great work! Having a quick colormap reference page in the docs would be awesome. Thanks!
I agree the naming is too confusing, but it's too late in the day for me to come up with a better name for either. But I agree whatever we do that aliasing (and deprecating the old name) is a good idea.
Lowercase spectral was added later, all by itself, while uppercase Spectral is part of the ColorBrewer set, so I would think the lowercase one should be renamed, since it isn't part of a group it needs to be consistent with.
(spectral is the only non-MATLAB-copied map that gets its own function. Is there any rhyme or reason to which ones should get this?)
Originally from neuroimaging project, so rename spectral to nipy_spectral in the same way as gist_rainbow was copied from the GIST project? But then what should spectral() do?
You are right, it wasn't. Somehow I thought you had solved all colormap problems.
Suggested pull request for this one: as you suggest, make nipy_spectral an alias for spectral (or vice-versa). I think I would then leave the spectral() function--it isn't doing any harm, and it has probably been there for a while--and modify the docstring to note that it is using nipy_spectral.
You would have to remove "spectral" from the list of cmaps in boilerplate.py, manually add an equivalent function to pyplot.py, and re-run boilerplate.py, which will propagate the first change into pyplot.py. See the boilerplate.py docstring.
Activity
mdboom commentedon May 18, 2012
This is great work! Having a quick colormap reference page in the docs would be awesome. Thanks!
I agree the naming is too confusing, but it's too late in the day for me to come up with a better name for either. But I agree whatever we do that aliasing (and deprecating the old name) is a good idea.
jswhit commentedon May 18, 2012
I added the "Spectral" colormap a long time ago while adding all the colormaps from here:
http://soliton.vm.bytemark.co.uk/pub/cpt-city/cb/div/index.html
DIdn't realize it had the same spelling as an existing colormap (or maybe the "spectral" colormap was added later?)
If anyone can suggest a better name I'll rename it (and leave an alias)
endolith commentedon May 18, 2012
Lowercase
spectralwas added later, all by itself, while uppercaseSpectralis part of the ColorBrewer set, so I would think the lowercase one should be renamed, since it isn't part of a group it needs to be consistent with.(
spectralis the only non-MATLAB-copied map that gets its own function. Is there any rhyme or reason to which ones should get this?)endolith commentedon May 19, 2012
Ok, I found it: http://sourceforge.net/mailarchive/message.php?msg_id=8931272
Originally from neuroimaging project, so rename
spectraltonipy_spectralin the same way asgist_rainbowwas copied from the GIST project? But then what shouldspectral()do?efiring commentedon Aug 13, 2012
Closed after #921 merge
endolith commentedon Aug 17, 2012
Unless I'm really confused, this wasn't solved by #921. Was it changed in some other place?
efiring commentedon Aug 17, 2012
You are right, it wasn't. Somehow I thought you had solved all colormap problems.
Suggested pull request for this one: as you suggest, make nipy_spectral an alias for spectral (or vice-versa). I think I would then leave the spectral() function--it isn't doing any harm, and it has probably been there for a while--and modify the docstring to note that it is using nipy_spectral.
endolith commentedon Aug 17, 2012
hmmm. so there will be
plt.cm.Spectralplt.cm.nipy_spectralplt.cm.spectral: alias forplt.cm.nipy_spectral, marked in the docstring as deprecatedspectral(): which is equivalent toset_cmap(plt.cm.nipy_spectral)efiring commentedon Aug 18, 2012
Alternative suggestions are welcome, but we can't simply delete spectral() or cm.Spectral or cm.spectral.
endolith commentedon Aug 20, 2012
def spectral():says
How do I edit the spectral function then?
efiring commentedon Aug 20, 2012
You would have to remove "spectral" from the list of cmaps in boilerplate.py, manually add an equivalent function to pyplot.py, and re-run boilerplate.py, which will propagate the first change into pyplot.py. See the boilerplate.py docstring.
endolith commentedon Aug 21, 2012
I left the
spectral()function in the footnotes, since it was an oddball anyway, and recommendedset_cmap('nipy_spectral')instead.dmcdougall commentedon Mar 23, 2013
Sorted! #1127 has been merged.