Skip to content

Color schemes for lines and maps, color-blind safe

Notifications You must be signed in to change notification settings

Descanonge/tol_colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tol_colors

Color schemes for lines and maps, color-blind safe

PyPI GitHub release

Those 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 those schemes can be found on his website and in the docs directory.

Install

Using pip:

pip install tol-colors

From source:

git clone https://github.com/Descanonge/tol_colors.git
cd tol_colors
pip install .

Get started

Get a colorset:

cset = tc.get_colorset('bright')

Get a colormap:

cmap = tc.get_colormap('sunset')

Show the available colorsets, colormaps, and the discrete rainbow colormap:

python -m tol_colors

See each function docstring for details.

To change the default matplotlib colorset or colormap:

import matplotlib.pyplot as plt
plt.rc('axes', prop_cycle=plt.cycler('color', list(tc.get_colorset('bright'))))
plt.colormaps.register(name='rainbow_PuRd', cmap=tc.get_colormap('rainbow_PuRd'))
plt.rc('image', cmap='rainbow_PuRd')

Requirements

  • numpy
  • matplotlib

See also

Other packages already implement these colorschemes and might better suit your needs:

About

Color schemes for lines and maps, color-blind safe

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages