Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1285
| From | TonyG <tgozdz@gmail.com> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: A Windows gnuplot-specific problem: Looking for a general procedure to pipe or redirect a system response or data into a gnuplot variable |
| Date | 2012-07-19 12:44 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <a2c17c25-8385-4e45-8638-4d127b827fdf@googlegroups.com> (permalink) |
| References | <0278e697-6c0e-4058-9a17-f91d757831bd@googlegroups.com> |
On Thursday, July 19, 2012 2:43:09 PM UTC-4, TonyG wrote:
> The subject line says it all; in recent posts in this group and on stackoverflow, I've asked about a way to pass system command-derived values or strings to gnuplot for use as labels, variables etc. Posters sfeam here and mgilson on stackoverflow suggested a couple of simple ways to achieve that--but these methods invariably result in the hated
>
> gnuplot> a = "`tail -1 data.out | awk '{print $1}'`"
> warning: system evaluation not supported by MS-Windows 32 bit
>
> error message on my Windows XP platform despite the fact that I extensively and successfully use various U*X and GNU utilities in other contexts.
>
> Thus my general question: what is the tested general way to pass a system-derived string or parameter to Windows (XP)-based gnuplot for use as a constant, label etc.?
OK, I finally found an answer to this problem: use gnuplot_pipes.exe, a version rnuplot 4.6 specifically created to handle pipes, redirection etc. on a Windows platform. In my specific example, these three commands will print the value taken from the 7th column in the 3rd from the end row of an external file 'data.out' on the sin(x) chart at the specified x,y location:
gnuplot> plot sin(x)
gnuplot> a=`tail -4 data.out | head -1 | awk '{print $7}' | sed 's/,//'
gnuplot> set label sprintf("a = %3.5g",a) at 0,.5
gnuplot> replot
Thanks to sfeam for suggesting the general approach.
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar
A Windows gnuplot-specific problem: Looking for a general procedure to pipe or redirect a system response or data into a gnuplot variable TonyG <tgozdz@gmail.com> - 2012-07-19 11:43 -0700 Re: A Windows gnuplot-specific problem: Looking for a general procedure to pipe or redirect a system response or data into a gnuplot variable TonyG <tgozdz@gmail.com> - 2012-07-19 12:44 -0700
csiph-web