小编Tom*_*ith的帖子

Python:如何在Seaborn Heatmap的定义值上将颜色条居中?

我正在尝试使用seaborn绘制热图。因此,我的值是从0到5,我需要设定一个蓝色到红色的色阶,白色是1,蓝色(低于1),红色(是1到5)。我该怎么做?

import seaborn as sns; sns.set()
hm=sns.heatmap(proportion, vmin=0, vmax=5, cmap='RdBu')
Run Code Online (Sandbox Code Playgroud)

这是我尝试做的,但不是自定义的……“比例”是我的变量。有什么我可以做的吗?

python matplotlib heatmap seaborn

5
推荐指数
1
解决办法
1816
查看次数

标签 统计

heatmap ×1

matplotlib ×1

python ×1

seaborn ×1