Code Monkey home page Code Monkey logo

tol_colors's Introduction

Tol_colors

Color schemes for lines and maps, color-blind safe

PyPI GitHub release

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.

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

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
plt.rc('axes', prop_cycle=plt.cycler('color', list(tc.tol_cset('bright'))))

plt.cm.register_cmap('rainbow_PuRd', tc.tol_cmap('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:

tol_colors's People

Contributors

descanonge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.