This is a static copy of a profile report

Home

legendcolorbarlayout (Calls: 16, Time: 0.165 s)
Generated 16-Jul-2020 17:10:09 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/scribe/legendcolorbarlayout.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
Legend.Legend>Legend.setAxesImplclass method8
Legend.Legend>Legend.setLocationImplclass method8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
hManager.addToTree(varargin{1}...
80.080 s48.9%
27
hManager  = matlab.graphics.sh...
160.077 s46.8%
37
hManager.addToLayout(varargin{...
80.003 s2.0%
19
if isa(hAx.Parent, 'matlab.gra...
160.002 s1.0%
15
if ~isvalid(hAx) || ~(isgraphi...
160.001 s0.5%
All other lines  0.001 s0.9%
Totals  0.165 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...anager>AxesLayoutManager.addToTreeclass method80.080 s48.4%
...nager>AxesLayoutManager.getManagerclass method160.076 s46.4%
...ager>AxesLayoutManager.addToLayoutclass method80.002 s1.5%
Self time (built-ins, overhead, etc.)  0.006 s3.7%
Totals  0.165 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function39
Non-code lines (comments, blank lines)18
Code lines (lines that can run)21
Code lines that did run15
Code lines that did not run6
Coverage (did run/can run)71.43 %
Function listing
time 
Calls 
 line
   1 
function hAxOut = legendcolorbarlayout(hAx,action,varargin)
   2 
%LEGENDCOLORBARLAYOUT Layout legend and/or colorbar around axes
   3 
%   This is a helper function for legend and colorbar. Do not call
   4 
%   directly.
   5 

   6 
%   LEGENDCOLORBARLAYOUT(AX,'addToTree',h) adds h as a child of the layout 
   7 
%   manager, but does not add h to the inner or outer list.  The position
   8 
%   of h will not be managed by the layout manager.
   9 
%   LEGENDCOLORBARLAYOUT(AX,'addToLayout',h) adds h to the end of the
  10 
%   layout list.
  11 

  12 
%   Copyright 1984-2018 The MathWorks, Inc.
  13 

  14 
% First, make sure we have a valid axes:
< 0.001 
     16 
  15
if ~isvalid(hAx) || ~(isgraphics(hAx,'axes') || isgraphics(hAx,'polaraxes') || isgraphics(hAx,'geoaxes')) 
  16 
    error(message('MATLAB:scribe:legendcolorbarlayout:InvalidAxes'));
< 0.001 
     16 
  17
end 
  18 

  0.002 
     16 
  19
if isa(hAx.Parent, 'matlab.graphics.layout.Layout') 
  20 
    if nargout > 0
  21 
        hAxOut = hAx;
  22 
        obj = varargin{1};
  23 
        obj.Parent = hAx.Parent;
  24 
    end
< 0.001 
     16 
  25
else 
  26 

  0.077 
     16 
  27
    hManager  = matlab.graphics.shape.internal.AxesLayoutManager.getManager(hAx); 
  28 

< 0.001 
     16 
  29
    if nargout > 0 
< 0.001 
      8 
  30
        hAxOut = hManager.Axes; 
< 0.001 
     16 
  31
    end 
  32 

< 0.001 
     16 
  33
    switch action 
< 0.001 
     16 
  34
        case 'addToTree' 
  0.080 
      8 
  35
            hManager.addToTree(varargin{1}); 
< 0.001 
      8 
  36
        case 'addToLayout' 
  0.003 
      8 
  37
            hManager.addToLayout(varargin{1}); 
< 0.001 
     16 
  38
    end 
< 0.001 
     16 
  39
end 

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