# HG changeset patch # User jwe # Date 1173926170 0 # Node ID b2096bb759b115742d6ff9154d772445c8b654e8 # Parent 2f64090cdc14d8e02176dc77e3bb144894a8d46e [project @ 2007-03-15 02:33:45 by jwe] diff -r 2f64090cdc14 -r b2096bb759b1 scripts/ChangeLog --- a/scripts/ChangeLog Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/ChangeLog Thu Mar 15 02:36:10 2007 +0000 @@ -1,5 +1,13 @@ 2007-03-14 John W. Eaton + * plot/__axis_label__.m: Accept additional property-value pairs + and pass them to __go_text__. Simply return the handle obtained + from __go_text__ instead of calling get on the current axis. + * plot/xlabel.m, plot/zlabel.m, plot/zlabel.m: Check args here. + Allow for extra property value pairs to be passed along. + * plot/title.m: Implement with __axis_label__ since it does all + that title needs to do. + * plot/clf.m: Set currentaxes property for current figure to []. * plot/__axis_label__.m: Convert arg to text handle before calling set. diff -r 2f64090cdc14 -r b2096bb759b1 scripts/miscellaneous/Makefile.in --- a/scripts/miscellaneous/Makefile.in Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/miscellaneous/Makefile.in Thu Mar 15 02:36:10 2007 +0000 @@ -20,7 +20,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -SOURCES = ans.m bincoeff.m bug_report.m bunzip2.m comma.m \ +SOURCES = ans.m bincoeff.m bug_report.m bunzip2.m cast.m comma.m \ compare_versions.m computer.m copyfile.m cputime.m \ delete.m dir.m doc.m dos.m dump_prefs.m \ fileattrib.m fileparts.m flops.m fullfile.m getfield.m gunzip.m \ diff -r 2f64090cdc14 -r b2096bb759b1 scripts/plot/__axis_label__.m --- a/scripts/plot/__axis_label__.m Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/plot/__axis_label__.m Thu Mar 15 02:36:10 2007 +0000 @@ -24,22 +24,18 @@ ## Author: jwe -function retval = __axis_label__ (caller, txt) - - ## If we have an even number of arguments, they should be - ## property-value pirs. +function retval = __axis_label__ (caller, txt, varargin) - if (nargin == 2) - if (ischar (txt)) - ca = gca (); - ## FIXME -- should be able to use text instead of __go_text__. - set (ca, caller, __go_text__ (ca, "string", txt)); - if (nargout > 0) - retval = get (ca, caller); - endif + if (ischar (txt)) + ## FIXME -- should be able to use text instead of __go_text__. + ca = gca (); + h = __go_text__ (ca, "string", txt, varargin{:}); + set (ca, caller, h); + if (nargout > 0) + retval = h; endif else - print_usage (); + error ("%s: expecting first argument to be character string"); endif endfunction diff -r 2f64090cdc14 -r b2096bb759b1 scripts/plot/title.m --- a/scripts/plot/title.m Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/plot/title.m Thu Mar 15 02:36:10 2007 +0000 @@ -26,17 +26,11 @@ function retval = title (varargin) - nargs = nargin; - - if (nargs == 0) - varargin{1} = ""; - nargs++; - endif - - if (nargs == 1) - set (gca, "title", varargin{1}); + if (rem (nargin, 2) == 1) if (nargout > 0) - retval = h; + h = __axis_label__ ("title", varargin{:}); + else + __axis_label__ ("title", varargin{:}); endif else print_usage (); diff -r 2f64090cdc14 -r b2096bb759b1 scripts/plot/xlabel.m --- a/scripts/plot/xlabel.m Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/plot/xlabel.m Thu Mar 15 02:36:10 2007 +0000 @@ -32,10 +32,14 @@ function h = xlabel (varargin) - if (nargout > 0) - h = __axis_label__ ("xlabel", varargin{:}); + if (rem (nargin, 2) == 1) + if (nargout > 0) + h = __axis_label__ ("xlabel", varargin{:}); + else + __axis_label__ ("xlabel", varargin{:}); + endif else - __axis_label__ ("xlabel", varargin{:}); + print_usage (); endif endfunction diff -r 2f64090cdc14 -r b2096bb759b1 scripts/plot/ylabel.m --- a/scripts/plot/ylabel.m Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/plot/ylabel.m Thu Mar 15 02:36:10 2007 +0000 @@ -26,10 +26,14 @@ function h = ylabel (varargin) - if (nargout > 0) - h = __axis_label__ ("ylabel", varargin{:}); + if (rem (nargin, 2) == 1) + if (nargout > 0) + h = __axis_label__ ("ylabel", varargin{:}); + else + __axis_label__ ("ylabel", varargin{:}); + endif else - __axis_label__ ("ylabel", varargin{:}); + print_usage (); endif endfunction diff -r 2f64090cdc14 -r b2096bb759b1 scripts/plot/zlabel.m --- a/scripts/plot/zlabel.m Wed Mar 14 22:06:15 2007 +0000 +++ b/scripts/plot/zlabel.m Thu Mar 15 02:36:10 2007 +0000 @@ -26,10 +26,14 @@ function h = zlabel (varargin) - if (nargout > 0) - h = __axis_label__ ("zlabel", varargin{:}); + if (rem (nargin, 2) == 1) + if (nargout > 0) + h = __axis_label__ ("zlabel", varargin{:}); + else + __axis_label__ ("zlabel", varargin{:}); + endif else - __axis_label__ ("zlabel", varargin{:}); + print_usage (); endif endfunction