mirror of
https://github.com/TeachBooks/template.git
synced 2026-11-12 22:25:52 +00:00
16 lines
327 B
Python
16 lines
327 B
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
t = np.linspace(0, 101)
|
|
y_2 = 1 / (1 + 0.02)**t
|
|
y_4 = 1 / (1 + 0.04)**t
|
|
|
|
fig = plt.figure()
|
|
plt.plot(t, y_2, label='2%')
|
|
plt.plot(t, y_4, label='4%')
|
|
plt.grid()
|
|
plt.legend()
|
|
plt.xlabel('Year')
|
|
plt.ylabel('Normalized Present Value [$-$]')
|
|
|
|
plt.savefig('present_value_py.svg')
|