import numpy as np from scipy.stats import f import matplotlib.pyplot as plt # get x values x = np.linspace(0, 4.5, 1000) # get F-Distributions f1 = f(3, 15, 0) f2 = f(5, 15, 0) f3 = f(10, 15, 0) f4 = f(15, 15, 0) # plot the distributions plt.figure(figsize=(12, 6)) plt.plot(x, f1.pdf(x), label = 'v1 = 3, v2 = 15', color = 'blue') plt.plot(x, f2.pdf(x), label = 'v1 = 5, v2 = 15', color = 'green') plt.plot(x, f3.pdf(x), label = 'v1 = 10, v2 = 15', color = 'red') plt.plot(x, f4.pdf(x), label = 'v1 = 15, v2 = 15', color = 'orange') plt.xlim(0, 4) plt.ylim(0.0, 1) plt.xticks(fontsize=16) plt.yticks(fontsize=16) plt.xlabel('f', fontsize=18) plt.ylabel('f(f)', fontsize=18) plt.title("F Distribution",fontsize=20) plt.legend(fontsize=14) #plt.savefig('C:/BOOK/PyBasics/PyStat/code/f_dist.png') plt.show()