在Seaborn Implot或FacetGrid中更改图例的字体大小

时间:2015-12-19 04:09:44

标签: python pandas matplotlib ipython seaborn

我使用Seaborn Implot和FacetGrid做了一些情节。我已经格式化了所有的轴刻度和标签。但是,从色调参数中获取的图例看起来太小了。我已经在我有限的能力范围内尝试了所有的想法,到目前为止似乎没有任何工作。有谁知道如何增加图例的字体大小?谢谢你的帮助。

以下是示例代码。图例(色调)显得太小。

with plt.rc_context(dict(sns.axes_style("darkgrid"),
                         **sns.plotting_context("notebook", font_scale=1.8))):
    g10 = sns.lmplot(x="DI", y="DT", col="NL", hue="NL",
                 data=sb4, col_wrap=2, aspect=1, size=7, legend=True, legend_out=True, lowess=False, ci=None,
                 palette="Set1", markers=["o", "D", "x", "s", "o"], scatter_kws={'s':35}, line_kws={'color':'green'})
# Add title to FacetGrid multiple plots
plt.subplots_adjust(top=0.94)
g10.fig.suptitle('Put Chart Title Here',
                 fontsize=20, fontweight='bold')
# Set parameters
g10.set(xlim=(-20, 120))
g10.set(ylim=(-1, 4))
plt.xticks(np.arange(-20, 120+20, 20))
plt.yticks(np.arange(-1, 4+1, 1))
# Use more informative axis labels than are provided by default
g10.set_axis_labels('CDS', 'CDT')
g10.add_legend()
g10.set_titles(fontweight='bold', size=16)
sns.plt.show()
# Save the plot as image file
g10.savefig("output-10.png")

0 个答案:

没有答案
相关问题