yt 项目中的一组 Matplotlib 颜色图
项目描述
厘米
yt 项目中的 Matplotlib 颜色图!
颜色图概述
以下颜色图及其各自的反向 ( *_r
) 版本可用
感知一致的顺序颜色图
单色顺序颜色图
各种各样的
安装
和pip
python3 -m pip install cmyt
或与conda
conda install -c conda-forge cmyt
用法
cmyt 以与cmocean或 cmasher类似的方式与 matplotlib 集成
import numpy as np
import matplotlib.pyplot as plt
import cmyt # that's it !
# generate example data
prng = np.random.RandomState(0x4D3D3D3)
noise = prng.random_sample((100, 100))
x, y = np.mgrid[-50:50, -50:50]
z = 5 * np.exp(-(x ** 2 + y ** 2) / 1000)
# setup the figure
fig, ax = plt.subplots()
ax.set(aspect="equal")
# now we can refer to cmyt colormaps as strings
im = ax.pcolormesh(x, y, z + noise, cmap="cmyt.arbre", shading="flat")
fig.colorbar(im, ax=ax)
# alternatively, cmyt maps can also be imported as objects
from cmyt import pastel
fig, ax = plt.subplots()
ax.set(aspect="equal")
im = ax.contourf(x, y, z + noise, cmap=pastel)
fig.colorbar(im, ax=ax)
测试目录中提供了使用 cmyt 中所有颜色图的可比较示例库。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
cmyt-1.1.2.tar.gz
(29.5 kB
查看哈希)
内置分布
cmyt-1.1.2-py3-none-any.whl
(30.5 kB
查看哈希)