|
From: Benjamin R. <ben...@ou...> - 2013-04-01 01:32:39
|
On Sun, Mar 31, 2013 at 11:51 AM, Sayan Chatterjee < say...@gm...> wrote: > Thank you very much I have been able to plot from the data files, but > facing a slight glitch. The data points are being super imposed in > consecutive plots.That means if the 1st data file contains 50 points and > the second 30. The second plot will contain 80 points! How to go about this > problem? > > for i in range(0,20): > fname = 'file_' + str(i) + '.dat' > f=open(fname,"r") > x,y = np.loadtxt(fname, unpack=True) > plt.scatter(x,y) > pylab.savefig(fname + '.png') > f.close() > > Sayan, Try putting "plt.cla()" after the call to "pylab.savefig()". Ben Root |