import numpy import matplotlib import matplotlib.pyplot as plt l = [1,2,3,4,5,6,7,8,9,10] a = numpy.array(l) b = a + numpy.random.rand(10)-0.5 matplotlib.rcParams.update({'font.size':22})#sets all the font to size 22 plt.clf() plt.plot(a,label="Fit line") plt.plot(b,'o',label="Data") plt.errorbar(a,a,b/10.0,fmt="o",label="More data") plt.legend(loc=2,fontsize=30)#here I have set the font size for just the legend plt.xlim(a.min()-1,a.max()+1) plt.ylim(b.min()-1,b.max()+1) plt.xlabel('$\exp(-(t-\mu)^2)/\sigma^2$ [s]') # latex plt.grid(True) plt.axvline(5) plt.savefig("FirstPlot.pdf") plt.show()