如何删除海洋热图上的轴刻度线

问题描述 投票:2回答:1

我有一个令人讨厌的热图,但我需要删除显示为破折号的轴刻度线。我想要刻度标签,但只需要删除两个轴上每个刻度的破折号(-)。我当前的代码是:

sns.heatmap(df, annot=True, fmt='.2f', center=0)

enter image description here

我尝试过despine,但是没有用。

matplotlib seaborn axis-labels
1个回答
0
投票
ax = sns.heatmap(df, annot=True, fmt='.2f', center=0)
ax.tick_params(axis='both', which='both', length=0)
© www.soinside.com 2019 - 2024. All rights reserved.