Mercurial > hg > octave-lyh
diff scripts/plot/__plt_get_axis_arg__.m @ 17036:08dd9458684a
Overhaul __plt_get_axis_arg__ and newplot functions to avoid creating unnecessary axes.
* scripts/plot/__plt_get_axis_arg__.m: Only return an axis handle if found in
argument list. Do not create any figures or axes.
* scripts/plot/newplot.m: Overhaul to allow specifying an axis handle input.
Prepare figure and axes according to Matlab conventions.
* scripts/plot/line.m: Never call newplot() for a core graphic object.
Always plot into gca.
* scripts/plot/plot.m: Update to use new __plt_get_axis_arg__ and newplot
functions.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 24 Jul 2013 23:05:37 -0700 |
parents | 75d115e329b7 |
children | b5d6314314fc |
line wrap: on
line diff
--- a/scripts/plot/__plt_get_axis_arg__.m +++ b/scripts/plot/__plt_get_axis_arg__.m @@ -25,17 +25,7 @@ function [h, varargin, narg] = __plt_get_axis_arg__ (caller, varargin) - ## First argument can be a boolean which determines whether a new - ## axis will be created if none exists. - if (islogical (caller)) - nogca = caller; - caller = varargin{1}; - varargin(1) = []; - else - nogca = false; - endif - - ## Search for parent property + h = []; parent = find (strcmpi (varargin, "parent"), 1); ## Look for numeric scalar which is a graphics handle but not the @@ -65,28 +55,6 @@ else error ("%s: expecting parent value to be axes handle", caller); endif - else - ## No axis specified. Use current axis or create one as necessary. - f = get (0, "currentfigure"); - if (isempty (f)) - h = []; - else - h = get (f, "currentaxes"); - endif - if (isempty (h)) - if (nogca) - h = NaN; - else - h = gca (); - endif - endif - if (nargin < 2) - varargin = {}; - endif - endif - - if (ishandle (h) && strcmp (get (h, "nextplot"), "new")) - h = axes (); endif narg = length (varargin);