Hi,
I have some data like this, Actualy bigger than this more than this column and more than this rows.
Run1 Run2 Run3 RUN4 Run5
1 23 123 1234 12.33
2 12 124 1225 13.123
3 15 125 1345 32.32
4 18 135 1456 12.23
5 19 137 1563 12.43
6 12 141 1563 323.4
7 13 146 1246 23.43
8 17 151 1356 12.43
9 14 154 1355 123.3
10 16 146 1743 12.34
to plot these data I use the code as follows
import sys
import matplotlib.pyplot as plt
import numpy as np
import pylab as pl
f=open('c:/py/new3.txt')
data= np.loadtxt(f,type ,delimiter= None , skiprows=1, usecols=None)
dtype=np.array([0,1,2],dtype='int32')
"""dtype = base datatype to cast data to
delimiter = character used to specify boundry between fields
skiprows = number of leading rows to skip (in case you need to skip headers)
usecols = tuple indicating the specific columns of data you wish to extract"""
x=data[:,0]# read the whole first column
y=data[:,1]# read the whole second column
z=data[:,2]# read the whole third column
a=data[:,3]
pl.figure('abhi2')
pl.plot(x,...,y)
pl.plot(x,y,'r')
pl.plot(x,z,'g')
pl.plot(x,a,'b')
pl.xlabel('days')
pl.ylabel('yield')
pl.title('ABhifirst graph')
pl.show()
pl.savefig('abhi2.png')
from above i could able to plot up to four column of data and if i did same, might be i could plot some more column. But , question ? my column number is very big which i cant define each as above. I think i should make a loop to read each column. I would be happy if some one help me to find the code.
Thank you