By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

matplotlib for graph script for python

P: 4
Question1:
Expand|Select|Wrap|Line Numbers
  1. #col1    col2     col3            col4
  2. 171.4    130.5    7.2245646       0.3933173
  3. 98.2    133.1    6.8370089      -0.4387156
  4. 4.8    12.8    2.9705532      -1.4150375
  5. 225.1    193.5    7.705306      0.2182325
  6.  
Columns are separated with "\t".

I would like to plot of col3, col4 (from text data file) in order to
get a plot like:
Expand|Select|Wrap|Line Numbers
  1.   y
  2.   1 |
  3.     |          *    *
  4.     |      * *  *    *   *
  5.     0 _ _ *_ _ *__ *_ *_ _ _ _ _
  6.     |    * *  * * *   *  *
  7.     |     *  *   * *     *    *
  8.   -1| ______________________ x
  9.  
How to do it using matplotlib?

Question 2:
I try to make a plot using my column data like lists. Like:

########
Expand|Select|Wrap|Line Numbers
  1. from pylab import *
  2. x = [1.3, 4.5, 5]
  3. y = [2.3, 4.1, 6]
  4. plot(x,y)
  5. xlabel('xaxe')
  6. ylabel('yaxe')
  7. title('Plot name')
  8. plot(x,y,'r',label="Gallup",color='r',linewidth=0,markerfacecolor='g', markeredgecolor='y',marker='d')
  9. legend()
  10. show()
#######
Result: I got back a line plot. I known that is a bad way.
What is the best way for list?
Thanks
Ibra
May 11 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
You have posted in the Articles section. I am moving this question to the Python forum.

ADMIN
May 11 '07 #2

bartonc
Expert 5K+
P: 6,596
You have posted in the Articles section. I am moving this question to the Python forum.

ADMIN
Thanks, Mary. Your omnipotent omnipresence is much appreciated in the hectic days.
May 11 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks, Mary. Your omnipotent omnipresence is much appreciated in the hectic days.
LOL - Thats one way of putting it.
May 11 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.