Home »
Python »
Matplotlib MCQs
Which function is used to draw a scatter plot?
25. Which function is used to draw a scatter plot?
- scatterplot()
- pyscatter()
- scatters()
- scatter()
Answer: D) scatter()
Explanation:
To draw a scatter plot, you can simply use the scatter() function. This function is used to plot one dot for each observation. It accepts two arrays of the same length for the x and y-axis.
plt.scatter(x, y)
Where x and y can be the NumPy arrays.