import scipy.stats as st
import matplotlib.pyplot as plt
from numpy import linspace 
from math import sqrt,exp,log

chi2=st.chi2.pdf
xx=linspace(0,10)
for df,c in zip([1,2,3,5],['red','blue','green','purple']):
  plt.plot(xx,chi2(xx,df),c=c,label='df='+str(df))
plt.legend()

plt.show()