I have some output files ie frequency1 .txt , frequency2 .txt and so on (till 21). In each txt files I am having 10 columns and suppose n rows , now I need to plot column 2 and column 3 for all these txt files .I am able to plot for a single txt file
import numpy as np
from matplotlib import pyplot as plt
data=np.loadtxt('frequecy1.txt')
pl.plot(data[:,1],data[:,2],'bo')
X=data[:,1]
Y=data[:,2]
plt.plot(X,Y,':ro')
plt.ylim((0,55000))
plt.show()
How would I plot all the files?
numpyat all, but you could hack this by writing all the data to a single filewith open('path/to/outfile', 'a') as outfile: for infilepath in infilepaths: with open(infilepath) as infile: outfile.write(infile.read()+"\n")then loading that