Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #202
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | James Waldby <not@valid.invalid> |
| 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 16:41:29 +0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 40 |
| Message-ID | <in4v7p$g5g$9@dont-email.me> (permalink) |
| References | <in3j2j$og8$1@speranza.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Fri, 1 Apr 2011 16:41:29 +0000 (UTC) |
| Injection-Info | mx01.eternal-september.org; posting-host="QpLFULTyicz5UoDNG+JV0w"; logging-data="16560"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MPJmBm1rjV7rWHqAK+sKn" |
| User-Agent | Pan/0.133 (House of Butterflies) |
| Cancel-Lock | sha1:xnGF6YRBoPsZWxEOwr2mAACRGRQ= |
| Xref | x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:202 |
Show key headers only | View raw
On Thu, 31 Mar 2011 21:07:46 -0700, Nasser M. Abbasi wrote:
...
> 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.
...
Since you have a system() function, perhaps you also have a
popen() function available. In C, one would use (eg)
FILE *f = popen("/usr/bin/gnuplot", "w");
if (!f) exit(1); /* exit if error */
to open a pipe to gnuplot standard input, and thereafter use
fprintf (f, ...);
...
fflush (f);
to write data to gnuplot, such as "plot '-'" commands and
data sequences.
See eg <http://linux.die.net/man/3/popen> and
<http://bama.ua.edu/cgi-bin/man-cgi?popen+3C>
--
jiw
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar
How to re-use the same output device/xterm each time gnuplot is invoked? "Nasser M. Abbasi" <nma@12000.org> - 2011-03-31 21:07 -0700
Re: How to re-use the same output device/xterm each time gnuplot is invoked? geep <geep@boursomail.com> - 2011-04-01 15:09 +0000
Re: How to re-use the same output device/xterm each time gnuplot is invoked? sfeam <sfeam@users.sourceforge.net> - 2011-04-01 10:54 -0700
Re: How to re-use the same output device/xterm each time gnuplot is invoked? James Waldby <not@valid.invalid> - 2011-04-01 16:41 +0000
csiph-web