def plot_learning_function(xdata, ydata, yerr, order, aplot, poly):
with sns.axes_style('whitegrid'):
sns.set_context('paper')
xp = np.linspace(np.min(xdata), np.max(xdata), 1000)[:, None]
plt.figure()
plt.errorbar(xdata, ydata, yerr,
label='Nearest similarity', marker='s')
plt.plot(xp, poly(xp), '-',
label='Learning function (poly of order {})'.format(order))
# plt.plot(xp, least_squares_mdl(res.x, xp), '-', label='least squares')
plt.xlabel(r'Mutation level')
plt.ylabel(r'Average similarity (not normalised)')
plt.legend(loc='lower left')
plt.savefig(aplot, transparent=True, bbox_inches='tight')
plt.close()
评论列表
文章目录