MSE12 版 (精华区)

发信人: chumsdock (微笑服务), 信区: MSE12       
标  题: Pylab真爽
发信站: BBS 听涛站 (Wed Oct 19 01:39:30 2005), 转信

from scipy import *
from Numeric import *
from pylab import *
from matplotlib import rc
import sys

......(退极化矩阵子程省略)

def figure(a,b):
    rc('text', usetex=True)
    plot(a, b, linewidth=1.0)
    xlabel('x/a');ylabel('E$_x$');
    title("The relations between $E_x$ and x",fontsize=16)
    grid(True);savefig('a.png')
    show()
#-------------Main------------
if __name__ == '__main__':
    _x=arange(-5,5,0.05)
    Ex=[];Ey=[];Ez=[];x0=[]
    for point in _x:
        if abs(point)==0.5:continue
        pos=[point,0,0]
        E=-polar(pos)*mat('1;0;0')
        x0.append(point)
        Ex.append(E[0,0]);  Ey.append(E[1,0]);  Ez.append(E[2,0])
    figure(x0,Ex)
--
发信人: baichilt (柴王|爱你们), 信区: MSE12                            
很多时候达叔像个很可爱的小孩子,总觉得是给他一根冰棍就该乐半天的样子。
发信人: tinapig (优雅的猪:四海为家), 信区: MSE12                       
说道冰棍 我又想起来在大连的时候达叔出发前在宾馆里说 
我要吃冰棍 我要吃两根冰棍 说完就走出去 再回来时
左右手各拿一根冰棍 一边一口的吃着


※ 来源:·BBS 听涛站 tingtao.net·[FROM: 59.66.203.181]

此主题相关图片如下:a.png (24973 字节)
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.002毫秒