Exercise

Plotting the Model on the Data

Continuing with the same measured data from the previous exercise, your goal is to use a predefined model() and measured data times and measured_distances to compute modeled distances, and then plot both measured and modeled data on the same axis.

context figure

Instructions

100 XP
  • Use model_distances = model(times, measured_distances) to compute the modeled values.
  • Use plt.subplots() to create figure and axis objects.
  • Use axis.plot() to plot times vs measured_distances with options linestyle=" ", marker="o", color="black".
  • Use axis.plot() to also plot times vs model_distances with options linestyle="-", color="red".