This is a static copy of a profile report

Home

Function details for newplot>ObserveFigureNextPlotThis is a static copy of a profile report

Home

newplot>ObserveFigureNextPlot (Calls: 2, Time: 0.001 s)
Generated 01-May-2020 20:23:08 using performance time.
subfunction in file /Applications/MATLAB_R2018a.app/toolbox/matlab/graphics/newplot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
newplotfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
105
switch fig.NextPlot
20.000 s32.0%
117
case 'add'
20.000 s19.3%
120
if ~any(ishghandle(fig)) &...
20.000 s18.5%
106
case 'new'
20.000 s1.2%
113
case 'replace'
20.000 s0.3%
All other lines  0.000 s28.7%
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)10
Code lines (lines that can run)15
Code lines that did run8
Code lines that did not run7
Coverage (did run/can run)53.33 %
Function listing
time 
Calls 
 line
  98 
function fig = ObserveFigureNextPlot(fig, hsave)
  99 
%
 100 
% Helper fcn for preparing figure for nextplot, optionally
 101 
% preserving specific existing descendants.
 102 
% GUARANTEED to return a figure, even if some crazy combination
 103 
% of create / delete fcns deletes it.
 104 

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

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