分享几款好看的配色,搬走搬走,求个三连~~~
小编自调色系
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap=sns.diverging_palette(255, 5, as_cmap=True),
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()
绿色系
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap="Greens", #绿色系
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()
蓝色系
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap="Blues",#蓝色系
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()
紫色系
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap="Purples_r",#紫色系
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()
混色系1
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap="BuGn_r",#混色系1
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()
混色系2
sns.set(rc={"font.family": "Songti SC"})
g = sns.clustermap(
data=gene.corr(),
dendrogram_ratio=(0.1, 0.1),
figsize=(7, 7),
annot=True,
fmt=".2f",
cmap="Greys_r",#混色系2
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), rotation=90)
g.ax_heatmap.set_yticklabels(g.ax_heatmap.get_yticklabels(), rotation=0)
plt.show()