Skip to main content

Science Colour Maps is a small package containing several colour maps created using viscm.

Project description

SciCM: Scientific Colour Maps

Github release PyPI version License GitHub Actions CI

SciCM is a Python package aimed at providing a large set of colour maps designed for scientific data visualisation. The colour maps in SciCM have been designed to be as interchangeable as possible within the same category, e.g., all diverging colour maps included in SciCM do an (almost) equal job of displaying the data. All colour maps included in SciCM remain readable for people with red-green colour blindness (the most common type). This design frees the user in their choice of colour map to use for their data visualisation. SciCM also includes some simple colour map manipulation tools, for users that want to further customise their colour maps.

Quick start

Upon importing SciCM, the colour maps are registered with matplotlib, so they can be accessed by passing cmap='scicm.cmapname' to any plotting function that accepts a colour map (e.g. the cmap keyword in matplotlib). The colour map objects themselves can also be explicitly accessed using scicm.cm.cmapname. All colour maps have a reversed version, accessible through the same naming convention used by matplotlib (i.e. cmapname_r).

A simple example of SciCM in use:

    import numpy as np, matplotlib.pyplot as plt, scicm
    
    x = np.random.default_rng().normal(size=(200, 200))
    
    plt.imshow(x, cmap='scicm.Stone')
    plt.show()

Included Colour Maps

Documentation and use guides

SciCM's GitHub Wiki contains an extended quick start guide, the full documentation of the package, and a guide on how to choose the best colour map for your data.

SciCM in the broader colour map Python package ecosystem

SciCM is not the first package to include "good" (perceptually-uniform) colour maps, but meaningfully expands the current availabily of such maps. Compared to other similar packages:

  • matplotlib: Includes only 5 perceptually-uniform maps, which is less than 10% of all the available colour maps. The main aim of SciCM is to provide perceptually-uniform alternatives to the sequential, diverging, and cyclic colour map types in matplotlib.
  • ColorCET: Perhaps the closest colour map package to SciCM in both scope and size. The main difference being that ColorCET features a large set of variations for a small number of individual colour maps, whereas SciCM provides a large set of variations for a small number of colour map "types".
  • cmocean: A relatively small set of perceptually uniform colour maps, with a design clearly catered for geographic and oceanographic use. Of note is the oxy colour map included in cmocean, which was the main source of inspiration for SciCM's segmented category of colour maps.
  • CMasher: While there is some overlap between both packages, CMasher and SciCM are natural companions, as the two focus on offering alternatives to different sets of matplotlib's colour map categories.

Installation guide

The package is available for installation using pip:

>pip install scicm

Although you may wish to install it directly from GitHub, the following example being for the master branch:

>pip install git+https://github.com/MBravoS/scicm.git@master

How to cite the use of SciCM

If you are submitting work that uses SciCM for publication in a scientific journal, please include a mention of your use. Some journals include a dedicated section for this purpose (e.g., the Software section in the Astrophysical Journal), which would be the natural place to mention SciCM (please include a link to this repository). If such a section is not included on your journal or choice, please consider adding the following to your acknowledgements:

The analysis in this work has been performed using the Python programming language, with the open-source package SciCM (https://github.com/MBravoS/scicm).

Feel free to expand the previous statement to include the rest of the sofware used in your work! Note that we aim to submit SciCM for publication sometime in 2023, so how to acknowledge your use of SciCM will (hopefully) soon change.

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

scicm-1.0.5.tar.gz (352.9 kB view details)

Uploaded Source

Built Distribution

scicm-1.0.5-py3-none-any.whl (444.3 kB view details)

Uploaded Python 3

File details

Details for the file scicm-1.0.5.tar.gz.

File metadata

  • Download URL: scicm-1.0.5.tar.gz
  • Upload date:
  • Size: 352.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for scicm-1.0.5.tar.gz
Algorithm Hash digest
SHA256 0b75101f83d86736bb66a9ac22907c8d8e3bc7641411e4283c4bf13932c7df7e
MD5 61609fd6de8bca41b8aaaacd60d8f3e3
BLAKE2b-256 d35a8daa0130620dee8b9cda75eaebadf5c37d7c2f95736da06c71e477224b8d

See more details on using hashes here.

File details

Details for the file scicm-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: scicm-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 444.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for scicm-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9c0d14389847c1cff62cdc604797945d98f78ffde37518d13184e4db6950ae9b
MD5 8ad70c4af025aa3ad6fd6864045233fc
BLAKE2b-256 858cae7852e358c04a1fd9bfc32d6b4fad1a4a548ac5dcdc3926a5bf4e1dfc5c

See more details on using hashes here.

Supported by

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