# lineplot.py import numpy as np import pylab as plt # Make an x vector array x =np.linspace(0,2,100) # Make an array of y values for each x value # beta=39.0 implies kT=26 meV (average KE per particle of ideal gas at 300 K) y=1/(np.exp(11.6*(x-1))+1) w=1/(np.exp(38.7*(x-1))+1) z=1/(np.exp(387.0*(x-1))+1) #use pylab to plot x and y plot1 = plt.plot(x, y,'r',label='beta=11.6 (T= 1000K)') plot2 = plt.plot(x, w,'g',label='beta=38.7 (T=300 K)') plot3 = plt.plot(x, z,'b',label='beta= 387 (T=30K)') # give plot a title plt.title('Fermi Dirac Function mu= 1eV') #make axis labels plt.xlabel(' Energy (eV)') plt.ylabel('f(E)') # set axis limits #plt.xlim(0.0,7.0) plt.ylim(0.0,2.0) plt.legend(loc='upper left') # show the plot on the screen plt.show()