From: geep Newsgroups: comp.graphics.apps.gnuplot Subject: Re: How to re-use the same output device/xterm each time gnuplot is invoked? Date: Fri, 1 Apr 2011 15:09:49 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 57 Message-ID: References: NNTP-Posting-Host: gHhNvaGUF5At9J6VuitmMg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Pan/0.133 (House of Butterflies) X-Notice: Filtered by postfilter v. 0.8.2 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!gegeweb.org!aioe.org!.POSTED!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:201 On Thu, 31 Mar 2011 21:07:46 -0700, Nasser M. Abbasi wrote: > Hello; > > I am on linux, and I am very new to gnuplot, but I am trying to see if I > can use it to make animation by calling it from Fortran program. > > The setup is like this: > > > PROGRAM ----> gnuplot > > Where the actual call inside the program follow this logic > > LOOP > -- update data, create new data.txt file on disk from this data > CALL system('gnuplot batch.plt') -- call to make new plot > END LOOP > > and batch.plt would start as > > #!/usr/bin/gnuplot -persist > ... load data from data.txt and make plot # EOF > > The above works OK, but the problem is that each call makes a NEW xterm > on top of the earlier one. > > So if I run the loop for 10 time, I end up with 10 plots on 10 different > windows. If I remove -persist, then each plot window disappear, and new > one is created, etc... and one is not able to see the animation. > > What I want is to reuse the same window, basically erase the previous > plot (if any) on it, and make a new one on the same plot/window, to > obtain the effect of animation. > > But I am not sure how to do this. I need some kind of window ID/device > ID, to tell gnuplot to reuse that when starting a new process, since > each call to gnuplot from the program will create a new process. > > So, basically I want the gnuplot script to do something like > > -------------------- > IF window_ID allready exist, then send all output to it else create a > new window and assign it window_ID make plot to window_ID > --------------------- > > Any ideas how to do this, or even if it possible? > > thanks > --Nasser Hi, I haven't tried it myself, but gnuplot can make animated gifs - take a looke here: http://www.gnuplot.info/faq/faq.html Maybe it will be helpful. Cheers, Peter