How to increase the font size of the legend in my Seaborn plot?

前端 未结 2 569
长发绾君心
长发绾君心 2020-12-25 14:13

I have the following codes to create a Seaborn strip plot. I am having a hard time figuring out how to increase the font size of the legend appearing in the plot.

         


        
2条回答
  •  旧时难觅i
    2020-12-25 14:31

    There is a much easier way to do this today, simply set up your figure and then call

    plt.legend(fontsize='x-large', title_fontsize='40')
    

    https://matplotlib.org/api/_as_gen/matplotlib.pyplot.legend.html

    Might depend on the version of matplotlib you're using. I'm using 2.2.3 and it has the fontsize parameter but not the title_fontsize.

提交回复
热议问题