import numpy as np import matplotlib.pyplot as plt from scipy.stats import chi2 #x-axis ranges from 0 to 20 with .001 steps x = np.arange(0, 20, 0.001) #define multiple Chi-square distributions plt.plot(x, chi2.pdf(x, df=4), label='df: 4') plt.plot(x, chi2.pdf(x, df=6), label='df: 6') plt.plot(x, chi2.pdf(x, df=8), label='df: 8') #add legend to plot plt.legend()