问题描述
我正在尝试绘制利率线(复合、连续复合、简单)。 但是,我无法连续提取复利。
有人可以帮我吗? 我认为连续和复利线应该画同一条线,但我看到了它们之间的差距。
提前致谢!
import numpy as np
import matplotlib.pyplot as plot
import seaborn
import math
pv=5
r=0.15
n=60
t=np.linspace(0,n,n)
continous = pv * math.e**(r*t)
simple = pv*(1+r*t)
compound = pv*(1+r)**t
plot.figure(figsize = (7,7))
plot.title('difference of interest rates')
plot.xlabel('Number of years')
plot.ylabel('Values')
plot.xlim(0,5)
plot.ylim(5,11)
plot.plot(t,continous,'g--',label = 'continous')
plot.plot(t,simple,'b-',label = 'simple Interest')
plot.plot(t,compound,'r-',label = 'compound Interest')
plot.legend(fontsize = 10)
show()
print(simple)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)