Color schemes for lines and maps, color-blind safe
Thoses color schemes were designed by Paul Tol. This repository is only packaging his work so that it can be easily installed using pip. His work and details on how to use thoses schemes can be found on his website and in the docs directory.
Using pip:
pip install tol-colors
From source:
git clone https://github.com/Descanonge/tol_colors.git
cd tol_colors
pip install .
Show the available colorsets, colormaps, and discrete rainbow colormap:
import tol_colors as tc
tc.main()
Get a colorset:
cset = tc.tol_cset('bright')
Get a colormap:
cmap = tc.tol_cmap('sunset')
See the functions docstrings for details.
To change default colorset (for lines) and colormap:
import matplotlib.pyplot as plt
import tol_colors
plt.rc('axes', prop_cycle=plt.cycler('color', list(tol_colors.tol_cset('bright'))))
plt.colormaps.register(name='rainbow_PuRd', cmap=tol_colors.tol_cmap('rainbow_PuRd'))
plt.rc('image', cmap='rainbow_PuRd')
- numpy
- matplotlib
Other packages already implement these colorschemes and might better suit your needs: