After importing matplotlib.pyplot as plt, we draw line plots with the plt.plot() command.
Here is a code snippet for a simple example of plotting the temperature of the week:
# Import the Matplotlib moduleimport matplotlib.pyplot as plt# Use a list to store the daily temperaturet = [22.2,22.3,22.5,21.8,22.5,23.4,22.8]# Plot the daily temperature t as a line plotplt.plot(t)# Show the plotplt.show()
After you run the code, the following plot will be displayed as the output in the notebook cell:
When a single parameter is parsed, the data values are assumed to be on the y axis, with the indices on the x axis.
Remember to conclude each ...