spacedinosaur10 spacedinosaur10 - 1 year ago 223
Python Question

Matplotlib xticks font size if string

I am trying to change the font size of my x axis that happens to be strings and not numbers. I have changed other charts that have integers by using :


However, this dose not work for some of my graphs that have months in the place of integers. Keep in mind i am not using subplots.

Answer Source

Try setting the fontsize either by using the the fontsize keyword argument or if you want to globally change it to every plot in your script by updating the rcParams as

import matplotlib 
matplotlib.rc('xtick', labelsize=20)

Also look at this answer: How to change the font size on a matplotlib plot

Or here: How can I change the font size of ticks of axes object in matplotlib

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download