Complete the code to import the matplotlib plotting library.
import [1] as plt
We use matplotlib.pyplot to create plots in Python.
Complete the code to plot the first time series data.
plt.plot(time, [1], label='Series 1')
series2.time for both x and y.The first series data is stored in the variable series1.
Fix the error in the code to add a legend to the plot.
plt.[1]()legends() which does not exist.label() instead of legend().The correct function to show the legend is plt.legend().
Fill both blanks to plot the second series with a red dashed line and add a title.
plt.plot(time, series2, color='r', [1]='--') plt.[2]('Comparison of Two Series')
color instead of linestyle.xlabel instead of title.Use color='r', linestyle='--' to make a red dashed line and plt.title() to add a title.
Fill all three blanks to create a complete plot with labels, legend, and show it.
plt.plot(time, series1, label=[1]) plt.plot(time, series2, label=[2]) plt.legend() plt.[3]()
plt.legend without parentheses.plt.show() to display the plot.Labels are strings for the legend. Use plt.legend() to show the legend and plt.show() to display the plot.
