Activity 8.1: Plot mousetrap car findings
Contents
Activity 8.1: Plot mousetrap car findings#
Constructing a list#
If you have easy access to your mousetrap car data, please make a list with the values of one design parameter that you changed iteratively.
Make a second list of the distance the car traveled when you used each of those values. Make sure that the order is consistent in both of the lists.
Note the nature of the data and the units in comments before you make the lists.
If you donβt have access to those data, please use the fishing wire length and distance traveled from the previous notes.
# design parameter:
# units:
...
# distance traveled
# units:
...
Now, you have two lists.
Find out which design parameter value resulted in the maximum distance traveled.
# find greatest distance traveled
...
# find the location in the list of the greatest dist
...
# determine the corresponding design parameter value
...
How does the design parameter change the distance traveled?#
Lists make it very easy to plot one variable against another, which is a start to exploring the relationship between two parameters.
Make sure you have imported the matplotlib
package then apply the plot
method.
The first parameter in the plot
function goes on the x-axis.
import matplotlib.pyplot as plt
# make a scatter plot with the design parameter on the x-axis
plt.plot(...)
# label the axes with the appropriate name and units
plt.xlabel(...)
plt.ylabel(...)
#