1fig, ax1 = plt.subplots()
2
3ax1.set_ylabel("distance (m)")
4ax1.set_xlabel("time")
5ax1.plot(time, distance, "blue")
6
7ax2 = ax1.twinx() # create another y-axis sharing a common x-axis
8
9
10ax2.set_ylabel("velocity (m/s)")
11ax2.set_xlabel("time")
12ax2.plot(time, velocity, "green")
13
14fig.set_size_inches(7,5)
15fig.set_dpi(100)
16
17plt.show()
18