This is a static copy of a profile report

Home

newplot>ObserveFigureNextPlot (Calls: 5, Time: 0.001 s)
Generated 18-May-2021 16:05:23 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
107
switch fig.NextPlot
50.001 s37.6%
122
if ~any(ishghandle(fig)) &...
50.000 s24.1%
119
case 'add'
50.000 s9.7%
124
end
50.000 s4.3%
108
case 'new'
50.000 s2.2%
All other lines  0.000 s22.1%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function25
Non-code lines (comments, blank lines)11
Code lines (lines that can run)14
Code lines that did run8
Code lines that did not run6
Coverage (did run/can run)57.14 %
Function listing
time 
Calls 
 line
 100 
function fig = ObserveFigureNextPlot(fig, hsave)
 101 
%
 102 
% Helper fcn for preparing figure for nextplot, optionally
 103 
% preserving specific existing descendants.
 104 
% GUARANTEED to return a figure, even if some crazy combination
 105 
% of create / delete fcns deletes it.
 106 

< 0.001 
      5 
 107
switch fig.NextPlot 
< 0.001 
      5 
 108
    case 'new' 
 109 
        % if someone calls plot(x,y,'parent',h) and h is an axes
 110 
        % in a figure with NextPlot 'new', ignore the 'new' and
 111 
        % treat it as 'add' - just add the axes to that figure.
 112 
        if isempty(hsave)
 113 
            fig = figure;
 114 
        end
< 0.001 
      5 
 115
    case 'replace' 
 116 
        clf(fig, 'reset', hsave);
< 0.001 
      5 
 117
    case 'replacechildren' 
 118 
        clf(fig, hsave);
< 0.001 
      5 
 119
    case 'add' 
 120 
        % nothing
< 0.001 
      5 
 121
end 
< 0.001 
      5 
 122
if ~any(ishghandle(fig)) && isempty(hsave) 
 123 
    fig = figure;
< 0.001 
      5 
 124
end 

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