Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: TonyG 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: Thu, 19 Jul 2012 12:44:37 -0700 (PDT) Organization: http://groups.google.com Lines: 31 Message-ID: References: <0278e697-6c0e-4058-9a17-f91d757831bd@googlegroups.com> NNTP-Posting-Host: 68.171.143.241 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1342727428 25175 127.0.0.1 (19 Jul 2012 19:50:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 19 Jul 2012 19:50:28 +0000 (UTC) In-Reply-To: <0278e697-6c0e-4058-9a17-f91d757831bd@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=68.171.143.241; posting-account=aXvHDAoAAACxGpqfzAalYVozIuMdHcRf User-Agent: G2/1.0 X-Received-Bytes: 2807 Xref: csiph.com comp.graphics.apps.gnuplot:1285 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 stacko= verflow, I've asked about a way to pass system command-derived values o= r strings to gnuplot for use as labels, variables etc. Posters sfeam here = and mgilson on stackoverflow suggested a couple of simple ways to achieve t= hat--but these methods invariably result in the hated=20 >=20 > gnuplot> a =3D "`tail -1 data.out | awk '{print $1}'`&quo= t; =20 > warning: system evaluation not supported by MS-Windows 32 bit >=20 > error message on my Windows XP platform despite the fact that I extensive= ly and successfully use various U*X and GNU utilities in other contexts. >=20 > 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 con= stant, label etc.? OK, I finally found an answer to this problem: use gnuplot_pipes.exe, a ve= rsion rnuplot 4.6 specifically created to handle pipes, redirection etc. on= a Windows platform. In my specific example, these three commands will pri= nt the value taken from the 7th column in the 3rd from the end row of an ex= ternal file 'data.out' on the sin(x) chart at the specified x,y location: gnuplot> plot sin(x) gnuplot> a=3D`tail -4 data.out | head -1 | awk '{print $7}' | sed 's/,//' gnuplot> set label sprintf("a =3D %3.5g",a) at 0,.5 =20 gnuplot> replot Thanks to sfeam for suggesting the general approach.