<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># Draw samples from the distribution:

a, m = 3., 2.  # shape and mode
s = (np.random.pareto(a, 1000) + 1) * m

# Display the histogram of the samples, along with the probability
# density function:

import matplotlib.pyplot as plt
count, bins, _ = plt.hist(s, 100, normed=True)
fit = a*m**a / bins**(a+1)
plt.plot(bins, max(count)*fit/max(fit), linewidth=2, color='r')
plt.show()
</pre></body></html>