yt项目的一组Matplotlib颜色映射
项目描述
cmyt
yt项目的Matplotlib颜色映射!
颜色映射概述
以下颜色映射及其相应的反向(*_r
)版本可用
感知均匀的顺序颜色映射
单色顺序颜色映射
杂项
安装
使用 pip
python -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-2.0.0.tar.gz (30.5 kB 查看哈希值)
构建分发
cmyt-2.0.0-py3-none-any.whl (31.8 kB 查看哈希值)
关闭
cmyt-2.0.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4beef670f488818efc6ac30491bae81b63a71590936e8cdd3dc3fc9027ab4bfd |
|
MD5 | ab2e27801bdfe8eb77f4105c8aff32df |
|
BLAKE2b-256 | 0b29d2b60efe3b1695b95199ce421741a4f464c8256a26ba12d0ae3a4d8bf123 |
关闭
cmyt-2.0.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1b40f396d9b9545be93c2c82d35efcc1260e041db831fa5b009b972153267796 |
|
MD5 | 078dca22ec3b37baa321c5068684659f |
|
BLAKE2b-256 | ab22638eb42617ae88da3654f61273e385bb0215eb85216faec62e716dcf014c |