1. Home
  2. Data Science
  3. Matplotlib
  4. Which Matplotlib function sets axis labels?

Added 16 Sep 2025

Which Matplotlib function sets axis labels?

  1. plt.label()
  2. plt.xlabel()/plt.ylabel() Correct answer
  3. plt.axis_label()
  4. plt.set_label()

Correct answer

B. plt.xlabel()/plt.ylabel()

18 views

MCQSEXAM

Explanation

plt.xlabel() and plt.ylabel() set labels for the x-axis and y-axis respectively.

Reference

Asked in: Data Science Exams

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.xlabel.html

Preparing for an exam?

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