44 matplotlib label fontsize
How do I set the figure title and axes labels font size? For the font size you can use size/fontsize: from matplotlib import pyplot as plt fig = plt.figure () plt.plot (data) fig.suptitle ('test title', fontsize=20) plt.xlabel ('xlabel', fontsize=18) plt.ylabel ('ylabel', fontsize=16) fig.savefig ('test.jpg') Text properties and layout — Matplotlib 3.7.1 documentation Matplotlib can use font families installed on the user's computer, i.e. Helvetica, Times, etc. Font families can also be specified with generic-family aliases like ( {'cursive', 'fantasy', 'monospace', 'sans', 'sans serif', 'sans-serif', 'serif'} ). Note To access the full list of available fonts: matplotlib.font_manager.get_font_names()
Text in Matplotlib Plots — Matplotlib 3.7.1 documentation If you want to move the labels, you can specify the labelpad keyword argument, where the value is points (1/72", the same ...