This is a static copy of a profile report

Home

newplot (677 calls, 0.995 sec)
Generated 05-Aug-2011 13:03:26 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/newplot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
packdfunction11
plot_sourcesfunction6
genfig>plotfeatsubfunction222
genfig>plotflagsubfunction204
plot_powerspecfunction66
genfigAlpha>plotflagsubfunction144
plot1overf>getStatsPlotssubfunction20
genfigRmsfunction4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
74
ax = ObserveAxesNextPlot(ax, h...
6770.831 s83.5%
69
ax = gca(fig);
6710.044 s4.4%
64
fig = ObserveFigureNextPlot(fi...
6770.044 s4.4%
66
set(fig,'nextplot','add');
6770.022 s2.2%
78
end
6710.011 s1.1%
All other lines  0.044 s4.4%
Totals  0.995 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
newplot>ObserveAxesNextPlotsubfunction6770.831 s83.5%
newplot>ObserveFigureNextPlotsubfunction6770.022 s2.2%
gcffunction6710.011 s1.1%
Self time (built-ins, overhead, etc.)  0.131 s13.2%
Totals  0.995 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function78
Non-code lines (comments, blank lines)46
Code lines (lines that can run)32
Code lines that did run28
Code lines that did not run4
Coverage (did run/can run)87.50 %
Function listing
   time   calls  line
1 function axReturn = newplot(hsave)
2 %NEWPLOT Prepares figure, axes for graphics according to NextPlot.
3 % H = NEWPLOT returns the handle of the prepared axes.
4 % H = NEWPLOT(HSAVE) prepares and returns an axes, but does not
5 % delete any objects whose handles appear in HSAVE. If HSAVE is
6 % specified, the figure and axes containing HSAVE are prepared
7 % instead of the current axes of the current figure. If HSAVE is
8 % empty, NEWPLOT behaves as if it were called without any inputs.
9 %
10 % NEWPLOT is a standard preamble command that is put at
11 % the beginning of graphics functions that draw graphs
12 % using only low-level object creation commands. NEWPLOT
13 % "does the right thing" in terms of determining which axes and/or
14 % figure to draw the plot in, based upon the setting of the
15 % NextPlot property of axes and figure objects, and returns a
16 % handle to the appropriate axes.
17 %
18 % The "right thing" is:
19 %
20 % First, prepare a figure for graphics:
21 % Clear and reset the current figure using CLF RESET if its NextPlot
22 % is 'replace', or clear the current figure using CLF if its
23 % NextPlot is 'replacechildren', or reuse the current figure as-is
24 % if its NextPlot is 'add', or if no figures exist, create a figure.
25 % When the figure is prepared, set its NextPlot to 'add', and then
26 % prepare an axes in that figure:
27 % Clear and reset the current axes using CLA RESET if its NextPlot
28 % is 'replace', or clear the current axes using CLA if its NextPlot
29 % is 'replacechildren', or reuse the current axes as-is if its
30 % NextPlot is 'add', or if no axes exist, create an axes.
31 %
32 % See also HOLD, ISHOLD, FIGURE, AXES, CLA, CLF.
33
34 % Copyright 1984-2010 The MathWorks, Inc.
35 % $Revision: 5.13.6.11 $ $Date: 2010/05/20 02:26:04 $
36 % Built-in function.
37
677 38 if nargin == 0 || isempty(hsave)
0.01 671 39 hsave = [];
6 40 elseif ~isscalar(hsave) || ~ishghandle(hsave)
41 error('MATLAB:newplot:InvalidHandle', 'bad handle')
42 end
43
44
677 45 fig = [];
677 46 ax = [];
47
677 48 if ~isempty(hsave)
6 49 obj = hsave;
6 50 while ~isempty(obj)
18 51 if strcmp(get(obj,'type'),'figure')
6 52 fig = obj;
12 53 elseif strcmp(get(obj,'type'),'axes')
6 54 ax = obj;
6 55 end
18 56 obj = get(obj,'parent');
18 57 end
6 58 end
59
0.01 677 60 if isempty(fig)
0.01 671 61 fig = gcf;
671 62 end
63
0.04 677 64 fig = ObserveFigureNextPlot(fig, hsave);
65 % for clay
0.02 677 66 set(fig,'nextplot','add');
67
677 68 if isempty(ax)
0.04 671 69 ax = gca(fig);
6 70 elseif ~any(ishghandle(ax))
71 error('MATLAB:newplot:NoAxesParent', 'axis parent deleted')
72 end
73
0.83 677 74 ax = ObserveAxesNextPlot(ax, hsave);
75
677 76 if nargout
671 77 axReturn = ax;
0.01 671 78 end

Other subfunctions in this file are not included in this listing.