1. Home
  2. Data Science
  3. Matplotlib
  4. Which function is used to add text to a plot in Matplotlib?

Added 24 Feb 2024

Which function is used to add text to a plot in Matplotlib?

  1. plt.text() Correct answer
  2. plt.add_text()
  3. plt.annotate()
  4. plt.add_annotation()

Correct answer

A. plt.text()

15 views

MCQSEXAM

Explanation

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.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Matplotlib MCQs

Practise all Matplotlib MCQs

Similar MCQs