Complete the code to create a scatter plot with x and y data.
import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [5, 7, 4, 6, 8] plt.[1](x, y) plt.show()
The plt.scatter function creates a scatter plot using the x and y data points.
Complete the code to add a title to the scatter plot.
import matplotlib.pyplot as plt x = [1, 2, 3] y = [4, 5, 6] plt.scatter(x, y) plt.[1]('My Scatter Plot') plt.show()
The plt.title function adds a title to the plot.
Fix the error in the code to correctly plot a scatter plot with red color.
import matplotlib.pyplot as plt x = [1, 2, 3] y = [3, 2, 1] plt.scatter(x, y, color=[1]) plt.show()
The color value must be a string, so it needs quotes like 'red'.
Fill both blanks to create a scatter plot with blue points and label the x-axis as 'Age'.
import matplotlib.pyplot as plt x = [20, 25, 30] y = [5, 7, 9] plt.scatter(x, y, color=[1]) plt.[2]('Age') plt.show()
Use color='blue' to set point color and plt.xlabel('Age') to label the x-axis.
Fill all three blanks to create a scatter plot with green points, label the y-axis as 'Height', and add a plot title 'Height vs Age'.
import matplotlib.pyplot as plt x = [18, 22, 26] y = [160, 170, 180] plt.scatter(x, y, color=[1]) plt.[2]('Height') plt.[3]('Height vs Age') plt.show()
Use color='green' for points, plt.ylabel('Height') for y-axis label, and plt.title('Height vs Age') for the plot title.