Skip to main content

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

Project description

Please see : http://colormap.readthedocs.io/ for an up-to-date documentation.

https://badge.fury.io/py/colormap.svg https://github.com/cokelaer/colormap/actions/workflows/ci.yml/badge.svg?branch=master https://coveralls.io/repos/cokelaer/colormap/badge.png?branch=master
version:

Python 3.6, 3.7, 3.8, 3.9

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', 'white', 'green(w3c)')
    cmap = c.test_colormap(mycmap)
http://colormap.readthedocs.io/en/latest/_images/index-1.png
  • check out the available colormaps:

    c = Colormap()
    c.plot_colormap('diverging')
http://colormap.readthedocs.io/en/latest/_images/colormaps.png

See online documentation for details: http://colormap.readthedocs.io/

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-1.0.4.tar.gz (17.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: colormap-1.0.4.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for colormap-1.0.4.tar.gz
Algorithm Hash digest
SHA256 9569fc231b6b25f0bf34ea01e553c093820a48463e55ef2043b5da72aef5a6fc
MD5 d20d253cac416f61e9e755addb9bcbb2
BLAKE2b-256 ac1b75c9152c1636064abcd5b2b0eb674dbc71cde985b2337cdc906e81f59b75

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