import matplotlib.pyplot as plt from scipy.stats import gamma import numpy as np x = np.linspace(0, 10, 500) alpha = 3 beta = 1 rv = gamma(alpha, loc = 0., scale = 1/beta) plt.plot(x, rv.pdf(x))