import matplotlib.pyplot as plt numargs = generic.numargs [ ] = ['Replace with resonable value', ]*numargs # Display frozen pmf: rv = generic() x = np.arange(0, np.min(rv.dist.b, 3)+1) h = plt.plot(x, rv.pmf(x)) # Here, ``rv.dist.b`` is the right endpoint of the support of ``rv.dist``. # Check accuracy of cdf and ppf: prb = generic.cdf(x, ) h = plt.semilogy(np.abs(x-generic.ppf(prb, ))+1e-20) # Random number generation: R = generic.rvs(, size=100) # Custom made discrete distribution: vals = [arange(7), (0.1, 0.2, 0.3, 0.1, 0.1, 0.1, 0.1)] custm = rv_discrete(name='custm', values=vals) h = plt.plot(vals[0], custm.pmf(vals[0]))