def plot_box( self, fname_out = None):
sns.boxplot(x="Method", y="r2", data=self.df_best_expand, palette="PRGn")
sns.despine(offset=10, trim=True)
plt.ylabel( r"$r^2$")
plt.xlabel( "Methods")
if fname_out is not None:
plt.savefig( fname_out) # index should be stored.
elif self.fname is not None:
fname_out = self.fname[:-4] + '_box.eps'
print( 'Default: the figure of self.df_best_expand is saved to', fname_out)
plt.savefig( fname_out)
评论列表
文章目录