import numpy as np
import matplotlib.pyplot as plt

a = 1           # left bound
b = 99          # right bound
sample = 1000  # sample times

S = np.random.uniform(a, b, sample)

plt.figure('Cumulative Distribution')
plt.hist(S, bins=100, density=True, cumulative=True)
plt.xlabel('x')
plt.ylabel('Pr[X<=x]')
plt.title('Uniform sample %d times between %.2f and %.2f. Mean = %.2f.' % (sample, a, b, np.mean(S)))
plt.grid()
plt.show()
