Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to set viridis as default colormap in mpl 1.x #6265

Closed
jankatins opened this issue Apr 3, 2016 · 2 comments
Closed

Document how to set viridis as default colormap in mpl 1.x #6265

jankatins opened this issue Apr 3, 2016 · 2 comments

Comments

@jankatins
Copy link
Contributor

I've now tried to google how to set viridis default matplotlib and none of the first 20 pages contain any information how to set this as the default colormap (e.g. in a notebook session). It also looks like there is no "mpl20" style available and the docs only talk about "use default and you get it in the future".

The second page in my google results contain a stackoverflow post which does not work:

import colormaps as cmaps
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-52-2b4a939ab51e> in <module>()
----> 1 import colormaps as cmaps

ImportError: No module named 'colormaps'

[conda env with py3.5 and latest available mpl from today]

Please add this information now so that google at least contains something useful and not only "in the future" talk when the map is available now.

@tacaswell
Copy link
Member

mpl.rcParams['image.cmap'] = 'viridis'

Assuming you have a matplotlib 1.5+. Other wise install a new(ish) version of skimage who have vendored and install viridis if needed.

@jankatins
Copy link
Contributor Author

Thanks! IMO this inforation should be included in http://matplotlib.org/style_changes.html and https://bids.github.io/colormap/ (the two higest results for "viridis default colormap". The third is funnily a link to the R version, which includes an example how to use it.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants