您的位置:首页 > 其它

How to use pylab to plot figure()?

2015-07-10 20:11 204 查看
#quote from MIT 'introduction to computation and programming using python, Revised'
import pylab
principle = 10000 #initial investment
interestRate = 0.05
years = 20
values = []
for i in range(years + 1):
values.append(principle)
principle += principle*interestRate
pylab.plot(values)
pylab.title('5% Gowth, Compounded Annually')
pylab.xlabel('Years of Compounding')
pylab.ylabel('Value of Principle($)')
pylab.show()


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: