https://github.com/santisoler/viridis_cmap
Simple PIP package to use viridis colormap in matplotlib 1.4
https://github.com/santisoler/viridis_cmap
Last synced: 5 months ago
JSON representation
Simple PIP package to use viridis colormap in matplotlib 1.4
- Host: GitHub
- URL: https://github.com/santisoler/viridis_cmap
- Owner: santisoler
- License: gpl-3.0
- Created: 2016-11-07T14:52:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-07T15:00:35.000Z (about 9 years ago)
- Last Synced: 2025-06-25T19:42:13.192Z (7 months ago)
- Language: Python
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# viridis_cmap
Simple PIP package to use viridis colormap in matplotlib 1.4
# How to install
Clone the repository:
git clone https://www.github.com/santis19/viridis_cmap
then install the package with PIP:
cd viridis_cmap
sudo pip install .
Done! You are ready to use it.
# How to use viridis colormap
Just import the colormap in Python as follows:
from viridis_cmap.cmaps import viridis
Example:
import numpy as np
import matplotlib.pyplot as plt
from viridis_cmap.cmaps import viridis
x = np.linspace(-1.0, 1.0, 101)
x, y = np.meshgrid(x, x)
z = x**2 + y**2
plt.contourf(x, y, z, 15, cmap=viridis)
plt.colorbar()
plt.axes().set_aspect("equal")
plt.show()