我想用一个自定义颜色图绘制一个热图,尽管不完全是这样。在
我想要一张这样的彩色地图。在间隔[-0.6,0.6]中,颜色为浅灰色。高于0.6时,红色增强。低于-0.6另一种颜色,比如蓝色,会增强。在
如何使用python和matplotlib创建这样的colormap?
到目前为止我所拥有的:
在seaborn
中有一个命令seaborn.diverging_palette(220, 10, as_cmap=True)
,它生成一个从蓝光到灰红色的颜色映射。但与[-0.6,0.6]仍然没有差距。在
Tags:
颜色贴图在0..1范围内规格化。所以如果你的数据限制是-1..1,-0.6将规范化为0.2,+0.6将规范化为0.8。在
相关问题 更多 >
编程相关推荐