callumrollo/cmcrameri
소개
Making Fabio Crameri's perceptually uniform colourmaps for geosciences available on PyPI and conda-forge
기타 프로젝트측정된 스타 증가
- in 24h
- +2
- in 7 days
- +5
- in 15 days
- +7
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalcmcrameri
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 9.0 (2026-11-18).
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()
For a discretized colormap like batlow split into 25 levels, you can use the .resampled method on any of the colormaps:
plt.imshow(x, aspect='auto', cmap=cmc.batlow.resampled(25))
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()

The original colormap text files are shipped as part of the package. Find them on your system with:
from cmcrameri.cm import paths
paths
Previous releases
Versions 1.x of this package were based on Scientific colour maps version 8.0 (2023-06-14).
License
This work is licensed under an MIT license.
관련 프로젝트 살펴보기
불러오는 중…