def plot_measurements_and_simulation_results(time_points, ydata, y_sim):
pl.subplot2grid((4, 2), (0, 0))
pl.plot(time_points, ydata[:,0], label = "measurements")
pl.plot(time_points, y_sim[:,0], label = "simulation")
pl.title("Measurement data compared to simulation results")
pl.xlabel("t")
pl.ylabel("X", rotation = 0, labelpad = 20)
pl.legend(loc = "lower left")
pl.subplot2grid((4, 2), (1, 0))
pl.plot(time_points, ydata[:,1], label = "measurements")
pl.plot(time_points, y_sim[:,1], label = "simulation")
pl.xlabel("t")
pl.ylabel("Y", rotation = 0, labelpad = 15)
pl.legend("lower right")
pl.subplot2grid((4, 2), (2, 0))
pl.plot(time_points, ydata[:,2], label = "measurements")
pl.plot(time_points, y_sim[:,2], label = "simulation")
pl.xlabel("t")
pl.ylabel(r"\phi", rotation = 0, labelpad = 15)
pl.legend("lower left")
pl.subplot2grid((4, 2), (3, 0))
pl.plot(time_points, ydata[:,3], label = "measurements")
pl.plot(time_points, y_sim[:,3], label = "simulation")
pl.xlabel("t")
pl.ylabel("v", rotation = 0, labelpad = 20)
pl.legend("upperleft")
pl.subplot2grid((4, 2), (0, 1), rowspan = 4)
pl.plot(ydata[:,0], ydata[:, 1], label = "measurements")
pl.plot(y_sim[:,0], y_sim[:,1], label = "estimations")
pl.title("Measured race track compared to simulated results")
pl.xlabel("X")
pl.ylabel("Y", rotation = 0, labelpad = 20)
pl.legend(loc = "upper left")
pl.show()
评论列表
文章目录