Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import math
- def compute_population(T1, t, tau, C):
- under_atan = (T1 - t) / tau
- arcctg = math.pi / 2 - math.atan(under_atan)
- N_t = (C / tau) * arcctg
- return N_t
- C = 172 # billion man years
- T1 = 2000 # year 2K;
- tau = 45 # 45 years old;
- range_start_a = 2000 # start of the range
- end_range_b = 2020 # End of the range
- n =20 #количество точек построения
- step_h = (end_range_b-range_start_a)/(n-1) # calculate the step(dunno what the step)
- # Let's form lists with argument values and function values in them
- x_list = [range_start_a + step_h * i for i in range(n)]
- f_list = [compute_population(T1, t, tau, C) for t in x_list]
- #5. Построим линию графика, установим для нее цвет и толщину:
- line = plt.plot(x_list, f_list)
- plt.setp(line, color="blue", linewidth=2)
- #6. Выведем 2 оси, установим для них позицию zero:
- plt.gca().spines["left"].set_position("zero")
- plt.gca().spines["bottom"].set_position("zero")
- plt.gca().spines["top"].set_visible(False)
- plt.gca().spines["right"].set_visible(False)
- plt.show()
Add Comment
Please, Sign In to add comment