1. Home
  2. Data Science
  3. Matplotlib
  4. Which function is used to set the title of a plot in…

Added 24 Feb 2024

Which function is used to set the title of a plot in Matplotlib?

  1. plot_title()
  2. title() Correct answer
  3. set_title()
  4. setplot_title()

Correct answer

B. title()

15 views

MCQSEXAM

Explanation

title() sets the title of the current plot: plt.title("Sales 2026").

In the object-oriented interface the equivalent is ax.set_title(). Mixing up these two forms is the usual trap in this question.

Want more practice? Try the full set of Data Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is B? 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