Add 'Estimates' to legend
This commit is contained in:
parent
04f8235c43
commit
df78983576
@ -535,10 +535,10 @@ def plot_filter(xs, ys=None, c='#013afe', label='Filter', var=None, **kwargs):
|
||||
ys = xs
|
||||
xs = range(len(ys))
|
||||
|
||||
plt.plot(xs, ys, color=c, label=label, **kwargs)
|
||||
retval = plt.plot(xs, ys, color=c, label=label, **kwargs)
|
||||
|
||||
if var is None:
|
||||
return
|
||||
return retval
|
||||
|
||||
var = np.asarray(var)
|
||||
|
||||
@ -551,6 +551,8 @@ def plot_filter(xs, ys=None, c='#013afe', label='Filter', var=None, **kwargs):
|
||||
plt.fill_between(xs, std_btm, std_top,
|
||||
facecolor='yellow', alpha=0.2)
|
||||
|
||||
return retval
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -54,13 +54,13 @@ def plot_gh_results(weights, estimates, predictions, time_step=0):
|
||||
plt.gcf().canvas.draw()
|
||||
time.sleep(time_step)
|
||||
|
||||
book_plots.plot_filter(xs[:i+1], estimates[:i+1], marker='o')
|
||||
est, = book_plots.plot_filter(xs[:i+1], estimates[:i+1], marker='o')
|
||||
plt.xlim([-1, n+1])
|
||||
plt.ylim([156.0, 173])
|
||||
plt.gcf().canvas.draw()
|
||||
time.sleep(time_step)
|
||||
|
||||
plt.legend([act, scale, pred], ['Actual Weight', 'Measurement', 'Predictions'], loc=4)
|
||||
plt.legend([act, scale, est, pred], ['Actual Weight', 'Measurement', 'Estimates', 'Predictions'], loc=4)
|
||||
book_plots.set_labels(x='day', y='weight (lbs)')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user