# HG changeset patch # User jwe # Date 948845145 0 # Node ID 78e1e0007f0faaa6059eb35e9f9a4e83dba1e7a1 # Parent 6293a9d5650acd44b15f94d6d1a99c3d65bc63e3 [project @ 2000-01-26 00:05:43 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,11 @@ 2000-01-25 John W. Eaton + * plot/__axis_label__.m: New function. + Undo string escapes in text twice(!) before sending to gnuplot. + * plot/xlabel.m: Use it. + * plot/ylabel.m: Ditto. + * plot/zlabel.m: Ditto. + * plot/mesh.m: Fix error message to reflect reality. 2000-01-24 Cyril Humbert diff --git a/scripts/plot/xlabel.m b/scripts/plot/xlabel.m --- a/scripts/plot/xlabel.m +++ b/scripts/plot/xlabel.m @@ -30,17 +30,8 @@ ## Author: jwe -function xlabel (text) - - if (nargin != 1) - usage ("xlabel (text)"); - endif +function xlabel (...) - if (isstr (text)) - command = sprintf ("gset xlabel \"%s\"", text); - eval (command); - else - error ("xlabel: text must be a string"); - endif + __axis_label__ ("xlabel", all_va_args); endfunction diff --git a/scripts/plot/ylabel.m b/scripts/plot/ylabel.m --- a/scripts/plot/ylabel.m +++ b/scripts/plot/ylabel.m @@ -24,17 +24,8 @@ ## Author: jwe -function ylabel (text) - - if (nargin != 1) - usage ("ylabel (text)"); - endif +function ylabel (...) - if (isstr (text)) - command = sprintf ("gset ylabel \"%s\"", text); - eval (command); - else - error ("ylabel: text must be a string"); - endif + __axis_label__ ("ylabel", all_va_args); endfunction diff --git a/scripts/plot/zlabel.m b/scripts/plot/zlabel.m --- a/scripts/plot/zlabel.m +++ b/scripts/plot/zlabel.m @@ -26,16 +26,8 @@ ## Created: 3 July 95 ## Adapted-By: jwe -function zlabel (text) - - if (nargin != 1) - usage ("zlabel (text)"); - endif +function zlabel (...) - if (isstr (text)) - eval (sprintf ("gset zlabel \"%s\"", text)); - else - error ("error: zlabel: text must be a string"); - endif + __axis_label__ ("zlabel", all_va_args); endfunction diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2000-01-25 John W. Eaton + + * variables.cc (Fexist): Return 6 for built-in constants. + + * pt-plot.cc (Fgshow): Don't append " " after last arg. + (Fgset): Likewise. + 2000-01-23 John W. Eaton * ov-base-mat.h (octave_base_matrix::length): Return 0 for empty diff --git a/src/pt-plot.cc b/src/pt-plot.cc --- a/src/pt-plot.cc +++ b/src/pt-plot.cc @@ -1120,16 +1120,23 @@ { delete [] gnuplot_terminal_type; ostrstream buf; - for (int i = 2; i < argc; i++) + int i; + for (i = 2; i < argc-1; i++) buf << argv[i] << " "; + if (i < argc) + buf << argv[i]; buf << Vgnuplot_command_end << ends; gnuplot_terminal_type = buf.str (); } } - for (int i = 0; i < argc; i++) + int i; + for (i = 0; i < argc-1; i++) plot_buf << argv[i] << " "; + if (i < argc) + plot_buf << argv[i]; + plot_buf << Vgnuplot_command_end << ends; char *plot_command = plot_buf.str (); @@ -1165,8 +1172,11 @@ ostrstream plot_buf; - for (int i = 0; i < argc; i++) + int i; + for (i = 0; i < argc-1; i++) plot_buf << argv[i] << " "; + if (i < argc) + plot_buf << argv[i]; plot_buf << Vgnuplot_command_end << ends; diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -411,8 +411,8 @@ @deftypefn {Built-in Function} {} exist (@var{name})\n\ Return 1 if the name exists as a variable, 2 if the name (after\n\ appending @samp{.m}) is a function file in the path, 3 if the name is a\n\ -@samp{.oct} file in the path, or 5 if the name is a built-in function.\n\ -Otherwise, return 0.\n\ +@samp{.oct} file in the path, 5 if the name is a built-in function, or\n\ +6 is the name is a built-in constant. Otherwise, return 0.\n\ \n\ This function also returns 2 if a regular file called @var{name}\n\ exists in Octave's @code{LOADPATH}. If you want information about\n\ @@ -465,6 +465,10 @@ { retval = 5.0; } + else if (sr && sr->is_builtin_constant ()) + { + retval = 6.0; + } else if (sr && sr->is_user_function ()) { retval = 2.0;