Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmcrameri

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmcrameri

Perceptually uniform colormaps by Fabio Crameri

  • 1.9
  • PyPI
  • Socket score

Maintainers
1

cmcrameri

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

python versions

pypi Downloads

anaconda badge Conda Downloads

This is a Python wrapper around Fabio Crameri's perceptually uniform colormaps.

https://www.fabiocrameri.ch/colourmaps/

All credit for creating the colormaps to Fabio. Any errors in the Python implementation of colormaps are my own.

This version is based on Scientific colour maps version 8.0 (2023-06-14).

Install

With pip:

python -m pip install cmcrameri

With conda:

conda install -c conda-forge cmcrameri

Usage example

import cmcrameri.cm as cmc
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 1, 100)[np.newaxis, :]

plt.imshow(x, aspect='auto', cmap=cmc.batlow)
plt.axis('off')
plt.show()

Alternatively, the registered name string can be used.

import cmcrameri # required in order to register the colormaps with Matplotlib
...
plt.imshow(x, aspect='auto', cmap='cmc.batlow')

Extra instructions

You can access all the core colormaps from Fabio Crameri's list by cmcrameri.cm.<colormapname>.

You can use tab autocompletion on cmcrameri.cm if your editor supports it.

For a reversed colormap, append _r to the colormap name.

Categorical colormaps have the suffix S.

For an image of all the available colormaps without leaving the comfort of your Python session:

from cmcrameri import show_cmaps

show_cmaps()

Figure demonstrating the colormaps

The original colormap text files are shipped as part of the package. Find them on your system with:

from cmcrameri.cm import paths

paths

License

This work is licensed under an MIT license.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc