gnuplot terminal, "postscript", is not available

Ben Abbott bpabbott at mac.com
Tue Mar 24 07:54:10 CDT 2009


 
On Monday, March 23, 2009, at 09:57PM, "Ben Abbott" <bpabbott at mac.com> wrote:
>
>On Mar 23, 2009, at 8:12 PM, Ivan Sutoris wrote:
>
>> On Mon, Mar 23, 2009 at 11:25 PM, Ben Abbott <bpabbott at mac.com> wrote:
>>>
>>> On Mar 23, 2009, at 11:12 AM, Ben Abbott wrote:
>>>
>>>>
>>>> On Monday, March 23, 2009, at 09:29AM, "Ivan Sutoris"
>>>> <ivan.sutoris at gmail.com> wrote:
>>>>>
>>>>> Bug report for Octave 3.1.54+ configured for i686-pc-linux-gnu
>>>>>
>>>>> Description:
>>>>> -----------
>>>>>
>>>>> After compiling recent tip (9006:979d0492ff40), I can't print  
>>>>> figures
>>>>> to files (it worked with devel. version before and also in  
>>>>> 3.0.3). I
>>>>> get "error: gnuplot_drawnow: the gnuplot terminal, "postscript", is
>>>>> not available." I am using gnuplot 4.2 and the problem seems to  
>>>>> occur
>>>>> in line 44 of gnuplot_drawnow.m:
>>>>>
>>>>> available_terminals = __gnuplot_get_var__ (plot_stream,
>>>>> "GPVAL_TERMINALS");
>>>>>
>>>>> After this line, available_terminals contains NaN, so no terminal  
>>>>> is
>>>>> recognised. Could this be caused by this version of gnuplot not
>>>>> working corectly with __gnuplot_get_var__?
>>>>>
>>>>> Repeat-By:
>>>>> ---------
>>>>>
>>>>> plot(randn(100,1))
>>>>> print myfig.eps -depsc
>>>>>
>>>>
>>>> Ivan,
>>>>
>>>> My mistake. The GPVAL_TERMINALS variable apparently is only  
>>>> available for
>>>> gnuplot's developer's sources.
>>>>
>>>> I'll provide a patch later. In the meantime, you can short-circuit  
>>>> the
>>>> check in gnuplot_drawnow by ...
>>>>
>>>>     plot_stream = open_gnuplot_stream (2, []);
>>>>     available_terminals = __gnuplot_get_var__ (plot_stream,
>>>> "GPVAL_TERMINALS");
>>>>     available_terminals = regexp (available_terminals, "\\b\\w+\\b",
>>>> "match");
>>>> -     if (any (strcmpi (available_terminals, gnuplot_trim_term  
>>>> (term))))
>>>> +     if (true)
>>>>
>>>> Ben
>>>
>>> I've pushed the patch.
>>>
>>> Ben
>>
>> With the patch it works again, thank you for quick solution :)
>> However, when printing I get many (dozens) warnings that probably
>> should not be there:
>>
>> warning: implicit conversion from real matrix to real scalar
>>
>> I tried to identify the problem using debug_on_warning and it seems
>> that these occur in __go_draw_figure__.m and __go_draw_axes__.m with
>> fprintf and fputs commands, for example line 67 in the first one:
>>
>> fputs (plot_stream, "\nreset;\n");
>>
>> Here fputs expects just one file identifier, but actually plot_stream
>> is two element vector and so the conversion (and warning) takes place.
>>
>> Regards
>> Ivan Sutoris
>
>Thanks Ivan,
>
>I've been intending to track down that warning, but hadn't been  
>successful.
>
>Ben
>

Changeset attached. I'll push it later today.

Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-plot_stream.patch
Type: application/octet-stream
Size: 1846 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090324/bf1e1a80/attachment.obj 


More information about the Bug-octave mailing list