To change the font size of the title in a matplotlib figure, use the parameter fontsize:
title('mytitle', fontsize=8)
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.arange(-4,8,0.1)
y = 6.0 / ( 1.0 + np.exp(-0.6*x) )
line, = plt.plot(x, y, '--', linewidth=2)
ax.grid(True)
plt.title('How to change the title font size in a matplotlib figure ?', fontsize=8)
plt.savefig('change_matplotlib_title_size.png')
plt.show()
References
Links | Site |
---|---|
How do I set figure title and axes labels font size in matplotlib? | stackoverflow |
matplotlib.pyplot.title | python doc |