Complete the code to plot a solid line using matplotlib.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linestyle=[1]) plt.show()
The linestyle "-" creates a solid line in matplotlib.
Complete the code to plot a dashed line using matplotlib.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linestyle=[1]) plt.show()
The linestyle "--" creates a dashed line in matplotlib.
Fix the error in the code to plot a dotted line using matplotlib.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linestyle=[1]) plt.show()
The linestyle ":" creates a dotted line in matplotlib.
Fill both blanks to create a plot with a dashed line and label it 'Dashed'.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linestyle=[1], label=[2]) plt.legend() plt.show()
Use linestyle "--" for dashed line and label it "Dashed" for the legend.
Fill all three blanks to create a plot with a dotted line, label it 'Dotted', and set the line width to 2.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linestyle=[1], label=[2], linewidth=[3]) plt.legend() plt.show()
Use linestyle ":" for dotted line, label it "Dotted", and set linewidth to 2 for thicker line.
