Complete the code to set the line color to red.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], color=[1]) plt.show()
The color parameter sets the line color. Here, 'red' makes the line red.
Complete the code to set the line width to 3.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], linewidth=[1]) plt.show()
The linewidth parameter controls the thickness of the line. Setting it to 3 makes the line thicker.
Fix the error in the code to set the line color to blue.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], color=[1]) plt.show()
The color value must be a string with quotes. 'blue' or "blue" works, but here only one option is correct to avoid ambiguity.
Fill both blanks to set the line color to green and width to 2.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], color=[1], linewidth=[2]) plt.show()
Use 'green' for the color and 2 for the line width to get a green line with thickness 2.
Fill all three blanks to create a blue line with width 4 and label it 'My Line'.
import matplotlib.pyplot as plt plt.plot([1, 2, 3], [4, 5, 6], color=[1], linewidth=[2], label=[3]) plt.legend() plt.show()
Set color='blue', linewidth=4, and label='My Line' to create a thick blue line with a label shown in the legend.