from math import exp from random import uniform import matplotlib.pyplot as plt def f(n, f0=100): result = f0 for i in range(n): result *= exp(0.2 + uniform(-0.04, 0.04)) return result X = list(range(350)) y1 = [f(x) for x in X] y2 = [100*exp(0.2*x) for x in X] plt.plot(X, y1, X, y2) plt.show()