Mercurial > hg > octave-nkf
diff scripts/plot/figure.m @ 6283:7099f1ae465e
[project @ 2007-02-08 08:37:00 by jwe]
author | jwe |
---|---|
date | Thu, 08 Feb 2007 08:37:00 +0000 |
parents | 44c91c5dfe1d |
children | b649aa46950d |
line wrap: on
line diff
--- a/scripts/plot/figure.m +++ b/scripts/plot/figure.m @@ -29,9 +29,9 @@ nargs = nargin; - if (nargs == 0) - f = __uiobject_init_figure__ (); - elseif (mod (nargs, 2) == 1) + f = []; + + if (mod (nargs, 2) == 1) tmp = varargin{1}; if (ishandle (tmp) && strcmp (get (tmp, "type"), "figure")) f = tmp; @@ -47,19 +47,21 @@ endif endif - if (nargout > 0) - h = f; - endif - if (rem (nargs, 2) == 0) + if (isempty (f)) + f = __uiobject_init_figure__ (); + endif if (nargs > 0) set (f, varargin{:}); endif __uiobject_adopt__ (0, f); set (0, "currentfigure", f); - drawnow (); else print_usage (); endif + if (nargout > 0) + h = f; + endif + endfunction