Skip to main content

Utilities to ease manipulation of matplotlib colormaps and color codecs (e.g., hex2rgb)

Project description

https://badge.fury.io/py/colormap.svg https://secure.travis-ci.org/cokelaer/colormap.png https://coveralls.io/repos/cokelaer/colormap/badge.png?branch=master https://landscape.io/github/cokelaer/colormap/master/landscape.png https://badge.waffle.io/cokelaer/colormap.png?label=ready&title=Ready
version:

Python 2.7, 3.3, 3.4, 3.5

contributions:

Please join https://github.com/cokelaer/colormap

issues:

Please use https://github.com/cokelaer/colormap/issues

notebook:

Please see https://github.com/cokelaer/colormap/tree/master/notebooks

What is it ?

colormap package provides simple utilities to convert colors between RGB, HEX, HLS, HUV and a class to easily build colormaps for matplotlib. All matplotlib colormaps and some R colormaps are available altogether. The plot_colormap method (see below) is handy to quickly pick up a colormaps and the test_colormap is useful to see test a new colormap.

Installation

pip install colormap

Example

  • Create your own colormap from red to green colors with intermediate color as whitish (diverging map from red to green):

    c = Colormap()
    mycmap = c.cmap( {'red':[1,1,0], 'green':[0,1,.39], 'blue':[0,1,0]})
    cmap = c.test_colormap(mycmap)
  • Even simpler if the colormap is linear:

    c = Colormap()
    mycmap = c.cmap_linear('red', 'black', 'green')
    cmap = c.test_colormap(mycmap)
http://pythonhosted.org//colormap/_images/example.png
  • check out the available colormaps:

    c = Colormap()
    c.plot_colormap('diverging')
http://pythonhosted.org//colormap/_images/colormaps.png

See online documentation for details: http://pythonhosted.org//colormap/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colormap-0.9.9.tar.gz (15.8 kB view details)

Uploaded Source

File details

Details for the file colormap-0.9.9.tar.gz.

File metadata

  • Download URL: colormap-0.9.9.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for colormap-0.9.9.tar.gz
Algorithm Hash digest
SHA256 85572283f7db42d6490fc4d0499f342cf602abafa63edf3aae419cc110d2a645
MD5 c4c9a3b267eccf02d349c2b50bf50e9c
BLAKE2b-256 e0c85361b9cd93c5ba1786537e4bb9bf3d2a693b7cbe75714592e8006896cc10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page