|
From: Ethan M. <merritt@u.washington.edu> - 2005-10-04 22:55:17
|
On Tuesday 04 October 2005 03:35 pm, John W. Eaton wrote:
> On 4-Oct-2005, Petr Mikulik wrote:
>
> | > Another thing that would be very useful would be a way to query
> | > individual settings. Parsing text output would be OK, provided that
> | > it is easy to do that (i.e., the output is structured in some way, not
> | > some natural language thing) and the format does not change.
Would it be preferable if gnuplot's "show <foo>" command produced output
corresponding to the input syntax, just as "save" does now?
For example, for "show title"
current output:
title is "Foo", offset at ((character units) 0, 0, 0)
equivalent line in "save" corresponds in input syntax:
set title "Foo" offset character 0, 0, 0 font "" norotate
>> Do you mean gget.m from octave-forge?
>>
> it is a terrible kluge and has a built-in race condition because
> it sends a "save" command to gnuplot then waits a while (how long is
> long enough?) and then parses the output.
Can it not read back synchronously?
fprintf(GNUPLOT_OUT,"save '| outpipe'\n");
fflush(GNUPLOT_OUT);
while ( fgets(&line, sizeof(line), GNUPLOT_INPIPE) )
look_for_desired_option(&line);
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|