What function is used to add a colorbar to a plot in Matplotlib?
Correct answer
A. plt.colorbar()
18 views
A. plt.colorbar()
18 views
plt.colorbar() adds a colour scale beside a plot, showing how colours map to data values. It is typically used after imshow(), scatter() with a c argument, or contourf().
The other function names do not exist.
For more solved questions like this one, see Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.