我的图表标题在这个jointplot上的位置很糟糕。我尝试过移动loc = 'left、right和center,但它没有从它所在的位置移动。基于这个网站的其他建议,我也尝试过像ax.title.set_position([3, 15])这样的东西,但这也根本不起作用。对控制标题的位置有什么建议吗?
sns.jointplot(leagueWinners_season['Wins'], leagueWinners_season['Goals'], kind = 'reg', color = 'b')
plt.title('Season Winners Goal and Win Regression', loc = 'right', fontsize = 16)
plt.show()

发布于 2018-08-30 19:36:16
尝试使用
plt.title('Season Winners Goal and Win Regression', y=1.3, fontsize = 16)在这里您可以通过更改数字来调整y位置。在这里,y轴的位置在相对坐标系中,这意味着y=1意味着在图中最高的y位置,任何超过1的值都意味着将标题推得更高。
发布于 2018-08-30 19:46:01
另一种方法是使用plt.suptitle为图形提供居中标题,然后使用subplots_adjust在图形顶部为标题留出稍微多一点的空间:
plt.subplots_adjust(top=0.9)
plt.suptitle('Season Winners Goal and Win Regression', fontsize = 16)https://stackoverflow.com/questions/52096050
复制相似问题