请教python作图

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

请教python作图

hejibo

各位兄弟姐妹们,先祝大家新年快乐。万事吉祥!
 
如果有时间,帮我想想这个问题吧。先谢过了  :-)
 
我想用python的matplotlib画一个散点图。有以下条件:
1.如附件的数据文件,第一列为x,第二列为y,第三列为作图条件。当第三列的值为15时,将所在行的(x,y)画出来
2.希望为这个散点图加上一个背景,如附件所示。
 
我写了一个最基本的做散点图的code,如下所示。谢谢大家
#!/usr/bin/env python
from pylab import  *
filename = "D:\\Program Files\\python 2.4.3\\py2exe code\\fixation_xy.txt"
X = load(filename)
fixation_x = X[:, 0]
fixation_y= X[:, 1]
loc=X[:,2]
scatter(fixation_x,fixation_y,s=1, marker='^', c='r')
savefig('fixation.png', dpi=75)
show()

--
Best Regards,

         He Jibo
       [hidden email]
[hidden email]


---------------------------
He Jibo
Department of Psychology,
Beckman Institute for Advanced Science and Technology
University of Illinois, Urbana Champaign,
603 East Daniel St.,
Champaign, IL 61820
Tel: 217-244-4461(office)
217-244-6763(lab)
Email: [hidden email]



--
Best Regards,

         He Jibo
       [hidden email]
[hidden email]


---------------------------
He Jibo
Department of Psychology,
Beckman Institute for Advanced Science and Technology
University of Illinois, Urbana Champaign,
603 East Daniel St.,
Champaign, IL 61820
Tel: 217-244-4461(office)
217-244-6763(lab)
Email: [hidden email]
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese

background.PNG (9K) Download Attachment
fixation_xy.txt (168 bytes) Download Attachment