This is a static copy of a profile report

Home

newplot>ObserveFigureNextPlot (Calls: 60, Time: 0.004 s)
Generated 16-Jul-2020 17:08:40 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
108
switch fig.NextPlot
600.002 s44.3%
123
if ~any(ishghandle(fig)) &...
600.001 s15.9%
109
case 'new'
600.000 s9.4%
120
case 'add'
600.000 s8.3%
116
case 'replace'
600.000 s3.0%
All other lines  0.001 s19.0%
Totals  0.004 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
 101 
function fig = ObserveFigureNextPlot(fig, hsave)
 102 
%
 103 
% Helper fcn for preparing figure for nextplot, optionally
 104 
% preserving specific existing descendants.
 105 
% GUARANTEED to return a figure, even if some crazy combination
 106 
% of create / delete fcns deletes it.
 107 

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

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