import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import zipf
s = 2
size = 1000
random_numbers = zipf.rvs(s, size=size)
plt.hist(random_numbers, bins='auto', density=True)
plt.xlabel('Rank')
plt.ylabel('Frequency')
plt.title('Zipf Distribution (s={})'.format(s))
plt.show()