1. Home
  2. Data Science
  3. Matplotlib
  4. Long category names overlap on the x-axis. Which call…

Added 2 Nov 2026

Long category names overlap on the x-axis. Which call rotates the tick labels by 45 degrees?

  1. plt.xlim(45)
  2. plt.xlabel(rotate=45)
  3. plt.rotate_x(45)
  4. plt.xticks(rotation=45) Correct answer

Correct answer

D. plt.xticks(rotation=45)

16 views

MCQSEXAM

Explanation

plt.xticks(rotation=45), often with ha='right' and plt.tight_layout(), keeps long labels readable on bar charts.

Reference

Asked in: Data Science Interviews

Preparing for an exam?

Doubts & discussion

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