error: __gnuplot_get_var__: stream to gnuplot not open

Ben Abbott bpabbott at mac.com
Tue Apr 7 09:07:26 CDT 2009


On Apr 6, 2009, at 5:10 PM, Ben Abbott wrote:

> On Monday, April 06, 2009, at 04:50PM, "Michael D. Godfrey" <godfrey at isl.stanford.edu 
> > wrote:
>> A few comments on __gnuplot_default_font__.m:
>>
>> At line 65 it reads:
>>>     error ("__gnuplot_get_var__: Can not open fifo (%s)", msg);
>> This should read ... Can not make fifo...
>>
>> At line 85 it reads:
>>>        error ("__gnuplot_get_var__: Can not open fifo (%s)", msg);
>> This should read     ... s)", err);
>> There is no string msg returned by fopen.
>>
>> Do you know which of these errors is what you have been getting?
>> Michael
>
> I have no idea which line is responsible. I'll change the errors and  
> push the change this evening.
>
> Ben

With the changes in place, it is apparent that the plot_stream is not  
open. Meaning the figure property "__plot_stream__" is empty.

octave:1> close all; clear all; rehash; plot (1:10); terms =  
__gnuplot_get_var__ (gcf, "GPVAL_TERMINALS")
error: __gnuplot_get_var__: stream to gnuplot not open
error: called from:
error:   /Users/bpabbott/Development/Octave_Toolbox/ 
__gnuplot_get_var__/__gnuplot_get_var__.m at line 45, column 5

Trying a second time ...

octave:1> close all; clear all; rehash; plot (1:10); terms =  
__gnuplot_get_var__ (gcf, "GPVAL_TERMINALS")
terms = aqua canvas cgm corel dpu414 dumb dxf eepic emf emtex epslatex  
epson_180dpi epson_60dpi epson_lx800 fig ggi gif gnugraph gpic hp2623A  
hp2648 hp500c hpdj hpgl hpljii hppj imagen jpeg latex lua mf mif mp  
nec_cp6 okidata pbm pcl5 pdf pdfcairo png pngcairo postscript pslatex  
pstex pstricks qms regis rgip starc svg tandy_60dpi tek40xx tek410x  
texdraw tgif tkcanvas tpic uniplex unknown vttek wxt wxtp x11 xlib

To track down further, I removed the ";" at the end of the popen2  
statement in gnuplot_drawnow (open_gnuplot_stream)

114     [plot_stream(1), plot_stream(2), pid] = popen2 (cmd)

Now I get ...

octave:4> close all; clear all; rehash; plot (1:10); terms =  
__gnuplot_get_var__ (gcf, "GPVAL_TERMINALS")
error: __gnuplot_get_var__: stream to gnuplot not open
error: called from:
error:   /Users/bpabbott/Development/Octave_Toolbox/ 
__gnuplot_get_var__/__gnuplot_get_var__.m at line 45, column 5
error:   /Users/bpabbott/Development/Octave_Toolbox/ 
__gnuplot_get_var__/go.m at line 1, column 49
plot_stream =  4
plot_stream =

    4   5

pid =  44789

I should mention that for some Octave sessions this does not occur,  
and in other it only occurs once. To make it repeatable, I placed the  
sequence of commands in script file and ran it.

It appears that the figure property, "__plot_stream__", does not  
immediately set. If I add a check and issue a "drawnow" ...

  39   if (numel (h) == 1 && isfigure (h))
  40     ostream = get (h, "__plot_stream__");
  41     if (isempty (ostream))
  42       drawnow;
  43       ostream = get (h, "__plot_stream__");
  44     endif
  45   else
  46     ostream = h;
  47   endif

... then I get no error. If "drawnow" is replaced by "pause(0)" all  
works as well.

This looks like a bug to me.

John, can you confirm or explain?

Ben





More information about the Octave-maintainers mailing list