This is a static copy of a profile reportHome
newplot>ObserveAxesNextPlot (677 calls, 0.831 sec)
Generated 05-Aug-2011 13:03:29 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/newplot.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
newplot | function | 677 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
125 | cla(ax, 'reset',hsave); | 243 | 0.765 s | 92.1% |  |
126 | case 'replacechildren' | 434 | 0.022 s | 2.6% |  |
132 | if ~any(ishghandle(ax)) &&... | 677 | 0.011 s | 1.3% |  |
128 | case 'add' | 434 | 0.011 s | 1.3% |  |
123 | switch get(ax,'nextplot') | 677 | 0.011 s | 1.3% |  |
All other lines | | | 0.011 s | 1.3% |  |
Totals | | | 0.831 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cla | function | 243 | 0.754 s | 90.8% |  |
Self time (built-ins, overhead, etc.) | | | 0.077 s | 9.2% |  |
Totals | | | 0.831 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 31 |
Non-code lines (comments, blank lines) | 13 |
Code lines (lines that can run) | 18 |
Code lines that did run | 9 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 50.00 % |
Function listing
time calls line
108 function ax = ObserveAxesNextPlot(ax, hsave)
109 %
110 % Helper fcn for preparing axes for nextplot, optionally
111 % preserving specific existing descendants
112 % GUARANTEED to return an axes in the same figure as the passed-in
113 % axes, even if that axes gets deleted by an overzealous create or
114 % delete fcn anywhere in the figure.
115 %
116
117 % for performance only call ancestor when needed
677 118 fig = get(ax,'Parent');
0.01 677 119 if ~strcmp(get(fig,'Type'),'figure')
120 fig = ancestor(fig,'figure');
121 end
122
0.01 677 123 switch get(ax,'nextplot')
677 124 case 'replace'
0.77 243 125 cla(ax, 'reset',hsave);
0.02 434 126 case 'replacechildren'
127 cla(ax, hsave);
0.01 434 128 case 'add'
129 % nothing
434 130 end
131
0.01 677 132 if ~any(ishghandle(ax)) && isempty(hsave)
133 if ~any(ishghandle(fig))
134 ax = axes;
135 else
136 ax = axes('parent',fig);
137 end
138 end