|
From: Sayan C. <say...@gm...> - 2013-04-01 11:30:28
|
Thank you very much!!...'plt.cla()' worked!! One slight hiccup. Could you please tell me how to fix up the Y grid? I mean I want every plot to have scale from 0 to 15 (say), not that some will have -5 to 10 and some will have 5 to 20.Is it possible?...it's absolutely necessary for the concerned simulation. :) Sayan On 1 April 2013 07:02, Benjamin Root <ben...@ou...> wrote: > > > > 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 > -- -------------------------------------------------------------------------- *Sayan Chatterjee* Dept. of Physics and Meteorology IIT Kharagpur Lal Bahadur Shastry Hall of Residence Room AB 205 Mob: +91 9874513565 blog: www.blissprofound.blogspot.com Volunteer , Padakshep www.padakshep.org |