文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>使用matplotlib画y=sin(x)

使用matplotlib画y=sin(x)

时间:2008-05-22  来源:libin1983

大学时,我们使用Matlab画数学图形.
matplotlib 模块也提供了类似的功能.
matplotlib下载地址:  http://matplotlib.sourceforge.net/tutorial.html
matplotlib 依赖 numpy.

下面是我画图的代码.

#!/usr/bin/env python
#coding=GBK
import pylab
import math

a = range(0, 360+1) #度数
x = map(lambda x:math.pi*x/180.0, a)
#y = map(lambda x:math.sin(x*math.pi/180.0), a)
y = map(lambda x:math.sin(x), x)
pylab.plot(x,y)

pylab.title('y = sin(x)')
pylab.xlabel('x')
pylab.ylabel('y')

pylab.show()


500)this.width=500;" border="0">
相关阅读 更多 +
排行榜 更多 +
愤怒的兽人战争安卓版

愤怒的兽人战争安卓版

冒险解谜 下载
粉碎射手跑安卓版

粉碎射手跑安卓版

冒险解谜 下载
超能肉鸽安卓版

超能肉鸽安卓版

飞行射击 下载