This is a static copy of a profile report

Home

newplot>ObserveAxesNextPlot (Calls: 60, Time: 0.062 s)
Generated 16-Jul-2020 17:08:45 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/axis/newplot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
newplotfunction60
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
151
cla(ax, 'reset', hsave);
120.052 s84.2%
136
fig = ax.Parent;
600.003 s4.5%
137
if ~isempty(fig) && ~s...
600.002 s3.3%
141
switch ax.NextPlot
600.001 s1.9%
150
if (ax.prepareForPlot())
120.001 s1.5%
All other lines  0.003 s4.5%
Totals  0.062 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
clafunction120.052 s82.9%
Self time (built-ins, overhead, etc.)  0.011 s17.1%
Totals  0.062 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 run14
Code lines that did not run10
Coverage (did run/can run)58.33 %
Function listing
time 
Calls 
 line
 127 
function ax = ObserveAxesNextPlot(ax, hsave)
 128 
%
 129 
% Helper fcn for preparing axes for nextplot, optionally
 130 
% preserving specific existing descendants
 131 
% GUARANTEED to return an axes in the same figure as the passed-in
 132 
% axes, even if that axes gets deleted by an overzealous create or
 133 
% delete fcn anywhere in the figure.
 134 

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

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

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

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