missing pdf terminal; was --> [changeset] print.m (matlab compatibility)

Ben Abbott bpabbott at mac.com
Wed Mar 11 01:41:56 CDT 2009


On Mar 11, 2009, at 2:05 PM, John W. Eaton wrote:

> On 11-Mar-2009, Ben Abbott wrote:
>
> | On Mar 11, 2009, at 12:50 PM, John W. Eaton wrote:
> |
> | > On 11-Mar-2009, Ben Abbott wrote:
> | >
> | > | On Mar 11, 2009, at 12:13 AM, John W. Eaton wrote:
> | > |
> | > | > On 10-Mar-2009, Ben Abbott wrote:
> | > | >
> | > | > | Some weeks ago I wrote a short function to obtain values for
> | > | > | gnuplot's public variables.
> | > | > |
> | > | > | ... which can be used to obtain the version and patch-level
> | > | > |
> | > | > | 	ver = __gnuplot_get_var__ (gcf, "GPVAL_VERSION");
> | > | > | 	level = __gnuplot_get_var__ (gcf, "GPVAL_PATCHLEVEL");
> | > | > |
> | > | > | ... the X11 window id
> | > | > |
> | > | > | 	window_id = __gnuplot_get_var__ (gcf,  
> "GPVAL_TERM_WINDOWID");
> | > | > |
> | > | > | ... as well as the available gnuplot terminals
> | > | > |
> | > | > | 	terms = regexp (__gnuplot_get_var__ (gcf,  
> "GPVAL_TERMINALS"),
> | > "\\b
> | > | > \\w+
> | > | > | \\b", "match");
> | > | > |
> | > | > | Shall I commit this function and add a check to
> | > gnuplot_drawnow to
> | > | > | verify the terminal type is available in gnuplot just after
> | > the plot
> | > | > | stream is opened?
> | > | >
> | > | > Please post the function so we can discuss the implementation.
> | > | >
> | > | > jwe
> | > |
> | > | It's attached.
> | >
> | > So it won't work on Windows?  Maybe that doesn't matter for the
> | > particular case that we are looking at now since we are only  
> trying to
> | > improve the error message.  But in that case, maybe it shouldn't
> | > produce an error when called on a system that doesn't have mkfifo.
> | > Or should any use of this function go inside a try/catch block?
> |
> | You've lost me. Are you saying that the command below will not  
> work on
> | Windows?
> |
> | 	terms = regexp (__gnuplot_get_var__ (gcf, "GPVAL_TERMINALS"), "\\b 
> \\w+
> | \\b", "match");
> |
> | or that the function __gnuplot_get_var__ won't work on Windows?
> |
> | I attempted to mimic the mkfifo portion from gnuplot_drawnow (I
> | haven't studied what is being done there). Did get something wrong?
>
> The function begins with
>
>  function gp_var_value = __gnuplot_get_var__ (h, gp_var_name, fmt)
>
>    if (nargin == 0)
>      h = gcf ();
>    endif
>    if (nargin < 2)
>      print_usage ();
>    endif
>    if (nargin < 3)
>      fmt = '';
>    endif
>
>    ostream = get (h, "__plot_stream__");
>    if (numel (ostream) < 1)
>      error ("__gnuplot_get_var__: stream to gnuplot not open");
>    elseif (ispc ()) # || true
>      if (numel (ostream) == 1)
> 	error ("__gnuplot_get_var__: Need mkfifo that is not implemented  
> under Windows");
>      endif
>
> On a Windows system, we should end up in this block if ostream is
> valid.  If we are printing to a file, numel (ostream) will be 1 (if
> I'm reading gnuplot_drawnow.m correctly.  So then we should get the
> error about mkfifo not being implemented.
>
> jwe

ok,ok ... I had confused myself. I borrowed the code from  
__gnuplot_ginput__.m not from gnuplot_drawnow.

Does cygwin not have this capability?

In any event, I agree error handling needs some attention.

Ben




More information about the Octave-maintainers mailing list