用Seaborn构建的子图回归图

时间:2018-08-04 07:01:11

标签: python matplotlib seaborn subplot

我使用以下代码绘制了具有多重特征的回归图:

# get coeffs of linear fit
slope, intercept, r_value, p_value, std_err = stats.linregress(plotdata['Average precipitation in depth (mm per year)'],plotdata['Lifetime risk of maternal death (%)'])
plot regression line
fig4 = sns.regplot(plotdata['Average precipitation in depth (mm per year)'],plotdata['Lifetime risk of maternal death (%)'], data=plotdata)
fig4 = sns.set(font_scale=1.4)
fig4 = plp.annotate('r-square = {0:.2f}'.format(r_value**2), (0.05, 0.8), xycoords='axes fraction')
fig4 = plp.annotate('y = {0:.2f} + {0:.2f} x Average precipitation in depth (mm/year)'.format(intercept, slope), (0.05, 0.9), xycoords='axes fraction')
fig4 = plt.gcf() 
fig4.set_size_inches(10, 5)
#%%

enter image description here

我有几个,并且想将它们放在4x4的子图中。

我该怎么做?

0 个答案:

没有答案