From help-octave-request at bevo dot che dot wisc dot edu Mon Jan 3 13:14:44 2000 Subject: gshow key From: "John W. Eaton" To: bsapp at lanl dot gov Cc: help-octave at bevo dot che dot wisc dot edu Date: Mon, 3 Jan 2000 13:15:18 -0600 (CST) On 31-Dec-1999, Ben Sapp wrote: | Is there any way to record in an Octave variable the current state of | gnuplot's key variable? I would like to do the following in a script: | | ------------------------------------------- | record key state; | make key state what I need for next plot; | restore old key state; | ------------------------------------------- | | My first attempt looked like this: | -------------------------------------------- | octave:13> key_state = eval("gshow key") | error: value on right hand side of assignment is undefined | error: evaluating assignment expression near line 13, column 11 | | key is ON, position: top right corner | key is right justified, not reversed and not boxed | sample length is 4 characters | vertical spacing is 1 characters | width adjustment is 0 characters | key title is "" | | octave:13> key_state | error: `key_state' undefined near line 13 column 1 The problem is that Octave communicates with gnuplot using a one-way pipe. The information printed by gnuplot's show command is sent to stdout (or stderr?) but Octave does not read it. FWIW, I don't think the solution is to connect gnuplot and Octave using a two-way pipe, because then we would have to rely on being able to parse the output to get the information we want. That seems too unreliable to me (the information displayed is likely to change as gnuplot changes). jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------