Which function is used to add text to a plot in Matplotlib?
Correct answer
A. plt.text()
14 views
A. plt.text()
14 views
plt.text() places text at given data coordinates: plt.text(2, 5, "Peak").
plt.annotate() also adds text but is designed for notes with an arrow pointing at a data point. plt.add_text() does not exist.
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.