1. Home
  2. Data Science
  3. Matplotlib
  4. What is the purpose of the plt.xlabel() function in…

Added 24 Feb 2024

What is the purpose of the plt.xlabel() function in Matplotlib?

  1. To set the y-axis label
  2. To set the plot title
  3. To set the x-axis label Correct answer
  4. To display the plot

Correct answer

C. To set the x-axis label

15 views

MCQSEXAM

Explanation

plt.xlabel() sets the label of the x-axis: plt.xlabel("Year").

plt.ylabel() labels the y-axis, plt.title() sets the title and plt.show() displays the figure.

Practise more Data Science MCQs with answers and explanations on MCQsExam.com.

Doubts & discussion

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