Skip to content

jk-rieck/colormaps_from_palettable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colormaps_from_palettable

Python package to extract the continuous colormaps from the palettable package for easier use. (Except for the Wes Anderson colour scales, they do not make sense as continuous maps)

Requirements

palettable has to be installed.

Install in existing environment

Install from the repository using

pip install git+https://github.com/jk-rieck/colormaps_from_palettable.git

Usage

Online interactive examples can be found here:
simple example
and here:
more realistic example

Example of how to extract the continuous colormaps from the Scientific package and use the Vik colormap. (Example requires packages numpy and matplotlib)

import numpy as np
from matplotlib import pyplot as plt
import colormaps_from_palettable as cfp
cmaps = cfp.extract()['scientific']
some_sin = np.sin(np.linspace(0, np.pi, 20))
some_cos = np.cos(np.linspace(0, np.pi, 20))
some_data = some_sin[:, None] * some_cos[None, :]
plt.pcolormesh(some_data, cmap=cmaps['Vik'])
plt.colorbar()

You can also clone this repository and run the example notebook or more realistic example notebook if you want to try out all the colormaps. (You need ipywidgets for that...)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages