gpt4 book ai didi

python - Seaborn 头衔位置

转载 作者:行者123 更新时间:2023-11-30 22:08:45 25 4
gpt4 key购买 nike

我的图表标题在这个jointplot上的位置很糟糕。我尝试移动 loc = 'leftrightcenter,但它没有从原来的位置移动。I'我们还根据本网站的其他建议尝试了类似 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()

enter image description here

最佳答案

尝试使用

plt.title('Season Winners Goal and Win Regression', y=1.3, fontsize = 16)

您可以通过更改数字来调整 y 位置。这里,y 轴的位置位于相对坐标系中,这意味着 y=1 表示位于绘图中的最高 y 位置以及任何超过 1 的位置这意味着将头衔进一步推高。

关于python - Seaborn 头衔位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52096050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com