This is a static copy of a profile report

Home

newplot>ObserveAxesNextPlot (6629 calls, 1.089 sec)
Generated 14-Nov-2016 07:47:13 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/graphics/newplot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
newplotfunction6629
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
117
fig = get(ax,'Parent');
66290.484 s44.4%
118
if ~strcmp(get(fig,'Type'),'fi...
66290.202 s18.5%
122
switch get(ax,'nextplot')
66290.171 s15.7%
131
if ~any(ishghandle(ax)) &&...
66290.081 s7.4%
127
case {'add','new'}
66290.030 s2.8%
All other lines  0.121 s11.1%
Totals  1.089 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function31
Non-code lines (comments, blank lines)13
Code lines (lines that can run)18
Code lines that did run8
Code lines that did not run10
Coverage (did run/can run)44.44 %
Function listing
time 
calls 
 line
 107 
function ax = ObserveAxesNextPlot(ax, hsave)
 108 
%
 109 
% Helper fcn for preparing axes for nextplot, optionally
 110 
% preserving specific existing descendants
 111 
% GUARANTEED to return an axes in the same figure as the passed-in
 112 
% axes, even if that axes gets deleted by an overzealous create or
 113 
% delete fcn anywhere in the figure.
 114 
%
 115 

 116 
% for performance only call ancestor when needed 
  0.48 
   6629 
 117 
fig = get(ax,'Parent'); 
  0.20 
   6629 
 118 
if ~strcmp(get(fig,'Type'),'figure') 
 119 
  fig = ancestor(fig,'figure');
 120 
end
 121 

  0.17 
   6629 
 122 
switch get(ax,'nextplot') 
  0.01 
   6629 
 123 
  case 'replace' 
 124 
    cla(ax, 'reset',hsave);    
   6629 
 125 
  case 'replacechildren' 
 126 
    cla(ax, hsave);
  0.03 
   6629 
 127 
  case {'add','new'} 
 128 
    % nothing    
   6629 
 129 
end 
 130 

  0.08 
   6629 
 131 
if ~any(ishghandle(ax)) && isempty(hsave) 
 132 
  if ~any(ishghandle(fig))
 133 
    ax = axes;
 134 
  else
 135 
    ax = axes('parent',fig);
 136 
  end
 137 
end