Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.graphics.apps.gnuplot Subject: How to re-use the same output device/xterm each time gnuplot is invoked? Date: Thu, 31 Mar 2011 21:07:46 -0700 Organization: Aioe.org NNTP Server Lines: 52 Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: tUYQ4Ty9mMw9Pdc8TJRFQA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:199 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