Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python seaborn热图标签可以';不能清楚地显示_Python_Pandas_Seaborn - Fatal编程技术网

Python seaborn热图标签可以';不能清楚地显示

Python seaborn热图标签可以';不能清楚地显示,python,pandas,seaborn,Python,Pandas,Seaborn,我在Seaborn热图中存储标签时遇到问题。我的标签很长 correlation = df.corr() plt.figure(figsize=(10,10)) sns.heatmap(correlation, vmax=1, square=True,annot=True,cmap='cubehelix') plt.title('Correlation between different fearures') 你可以看到地图: 试试这个 correlation = df.corr() plt.

我在Seaborn热图中存储标签时遇到问题。我的标签很长

correlation = df.corr()
plt.figure(figsize=(10,10))
sns.heatmap(correlation, vmax=1, square=True,annot=True,cmap='cubehelix')
plt.title('Correlation between different fearures')
你可以看到地图:

试试这个

correlation = df.corr()
plt.figure(figsize=(10,10))
g = sns.heatmap(correlation, vmax=1, square=True,annot=True,cmap='cubehelix',xticklabels=True,yticklabels=True)
g.set_yticklabels(g.get_yticklabels(), rotation =0)
g.set_xticklabels(g.get_yticklabels(), rotation =90)
plt.title('Correlation between different fearures')

为什么要将xticklabels旋转1度?@mwaskom我想这里的1表示90*但我不太确定。是否愿意调整字体大小