This is a static copy of a profile report

Home

newplot>ObserveAxesNextPlot (Calls: 5, Time: 0.037 s)
Generated 18-May-2021 16:05:24 using performance time.
subfunction in file /usr/local/MATLAB/R2021a/toolbox/matlab/graphics/axis/newplot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
newplotfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
150
cla(ax, 'reset', hsave);
50.034 s91.2%
149
if (ax.prepareForPlot())
50.001 s2.3%
136
if ~isempty(fig) && ~s...
50.001 s2.1%
135
fig = ax.Parent;
50.001 s1.4%
140
switch ax.NextPlot
50.000 s1.0%
All other lines  0.001 s2.0%
Totals  0.037 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
clafunction50.031 s83.0%
Self time (built-ins, overhead, etc.)  0.006 s17.0%
Totals  0.037 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function41
Non-code lines (comments, blank lines)17
Code lines (lines that can run)24
Code lines that did run12
Code lines that did not run12
Coverage (did run/can run)50.00 %
Function listing
time 
Calls 
 line
 126 
function ax = ObserveAxesNextPlot(ax, hsave)
 127 
%
 128 
% Helper fcn for preparing axes for nextplot, optionally
 129 
% preserving specific existing descendants
 130 
% GUARANTEED to return an axes in the same figure as the passed-in
 131 
% axes, even if that axes gets deleted by an overzealous create or
 132 
% delete fcn anywhere in the figure.
 133 

 134 
% for performance only call ancestor when needed
< 0.001 
      5 
 135
fig = ax.Parent; 
< 0.001 
      5 
 136
if ~isempty(fig) && ~strcmp(fig.Type,'figure') 
 137 
    fig = ancestor(fig,'figure');
< 0.001 
      5 
 138
end 
 139 

< 0.001 
      5 
 140
switch ax.NextPlot 
< 0.001 
      5 
 141
    case 'replaceall' 
 142 
        cla(ax, 'reset', hsave);
< 0.001 
      5 
 143
    case 'replace' 
 144 
        % If there are multiple data spaces, ax.prepareForPlot() will do a
 145 
        % reset of the properties for the active data space (while
 146 
        % preserving other data spaces) and return false to indicate that a
 147 
        % full reset is not necessary. Otherwise, ax.prepareForPlot() will
 148 
        % return true.
< 0.001 
      5 
 149
        if (ax.prepareForPlot()) 
  0.034 
      5 
 150
            cla(ax, 'reset', hsave); 
 151 
        else
 152 
            cla(ax, hsave);
< 0.001 
      5 
 153
        end 
 154 
    case 'replacechildren'
 155 
        cla(ax, hsave);
 156 
    case 'add'
 157 
        % nothing
< 0.001 
      5 
 158
end 
 159 

< 0.001 
      5 
 160
if ~any(ishghandle(ax)) && isempty(hsave) 
 161 
    if ~any(ishghandle(fig))
 162 
        ax = axes;
 163 
    else
 164 
        ax = axes('Parent',fig);
 165 
    end
< 0.001 
      5 
 166
end 

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