代码之家  ›  专栏  ›  技术社区  ›  Chris Macaluso

海生职位

  •  1
  • Chris Macaluso  · 技术社区  · 7 年前

    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()
    

    enter image description here

    2 回复  |  直到 7 年前
        1
  •  3
  •   Sheldore    7 年前

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

    你可以在那里玩 y 是的 y=1 意味着最高 是的

        2
  •  7
  •   DavidG    7 年前

    另一种方法是使用 plt.suptitle 要为图形指定居中标题,请使用 subplots_adjust 要在图的顶部为标题留出更多的空间,请执行以下操作:

    plt.subplots_adjust(top=0.9)
    plt.suptitle('Season Winners Goal and Win Regression', fontsize = 16)
    
    推荐文章