# -*- coding: utf-8 -*-1"""2Created on Tue Jun 30 19:48:21 201534@author: rlabbe5"""67import matplotlib.pyplot as plt8import book_plots as bp91011def plot_track_and_residuals(t, xs, z_xs, res):12plt.subplot(121)13bp.plot_measurements(t, z_xs, label='z')14bp.plot_filter(t, xs)15plt.legend(loc=2)16plt.xlabel('time (sec)')17plt.ylabel('X')18plt.title('estimates vs measurements')19plt.subplot(122)20# plot twice so it has the same color as the plot to the left!21plt.plot(t, res)22plt.plot(t, res)23plt.xlabel('time (sec)')24plt.ylabel('residual')25plt.title('residuals')26plt.show()272829303132