Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

In a matplotlib figure, how can I make the font size for the tick labels using ax1.set_xticklabels() smaller?

Further, how can one rotate it from horizontal to vertical?

1 Answer

0 votes
by (106k points)

You can use the below-mentioned code to make tick labels font size smaller in Matplotlib:

import matplotlib.pyplot as plt 

ax = plt.subplots() 

ax.tick_params(axis='both', which='major', labelsize=10) 

ax.tick_params(axis='both', which='minor', labelsize=8)

This only answers to the size of label part of your question though.

Related questions

0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers
0 votes
1 answer

Browse Categories

...