import matplotlib.pyplot as plt
numargs = ncx2.numargs
[ df, nc ] = [0.9,] * numargs
rv = ncx2(df, nc)

# Display frozen pdf

x = np.linspace(0, np.minimum(rv.dist.b, 3))
h = plt.plot(x, rv.pdf(x))

# Check accuracy of cdf and ppf

prb = ncx2.cdf(x, df, nc)
h = plt.semilogy(np.abs(x - ncx2.ppf(prb, df, nc)) + 1e-20)

# Random number generation

R = ncx2.rvs(df, nc, size=100)
