This is a static copy of a profile report

Home

scribe/private/islegendable (51 calls, 0.109 sec)
Generated 05-Aug-2011 13:02:24 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/private/islegendable.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
scribe/private/get_legendable_childrenfunction51
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
9
if ismethod(h,'islegendable')
510.087 s80.0%
17
if ( (isempty(get(h,'xdata')) ...
510.022 s20.0%
44
end
510 s0%
43
res = hasbehavior(h,'legend');
510 s0%
42
if res && ~feature('HG...
510 s0%
All other lines  0 s0%
Totals  0.109 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ismethodfunction510.087 s80.0%
scribe/private/islegendable>isallnansubfunction510.011 s10.0%
hasbehaviorfunction1020 s0%
Self time (built-ins, overhead, etc.)  0.011 s10.0%
Totals  0.109 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function44
Non-code lines (comments, blank lines)15
Code lines (lines that can run)29
Code lines that did run17
Code lines that did not run12
Coverage (did run/can run)58.62 %
Function listing
   time   calls  line
1 function res=islegendable(h)
2 %ISLEGENDABLE Tests if an object should be can in a legend
3 % RES = ISLEGENDABLE(H) returns true if graphics object H can
4 % be shown in a legend.
5
6 % Copyright 1984-2010 The MathWorks, Inc.
7
8 % islegendable method takes precedence if it exists
0.09 51 9 if ismethod(h,'islegendable')
10 res = h.islegendable;
11 return
12 end
13
51 14 res= true;
51 15 switch get(h,'Type')
51 16 case {'line','patch','surface'}
0.02 51 17 if ( (isempty(get(h,'xdata')) || isallnan(get(h,'xdata'))) && ...
18 (isempty(get(h,'ydata')) || isallnan(get(h,'ydata'))) && ...
19 (isempty(get(h,'zdata')) || isallnan(get(h,'zdata'))) ) || ...
20 (~feature('HGUsingMATLABClasses') && ~hasbehavior(h,'legend'))
21 res = false;
22 end
23 case {'hggroup','hgtransform'}
24 if isempty(get(h,'Children'))
25 res = false;
26 end
27 otherwise
28 res = false;
29 end
30
31 % Take the "LegendEntry" display property into account.
51 32 if res
51 33 hA = get(h,'Annotation');
51 34 if ishandle(hA) || (isobject(hA) && isvalid(hA))
51 35 hL = hA.LegendInformation;
51 36 if ishandle(hL) || (isobject(hL) && isvalid(hL))
51 37 res = ~strcmpi(hL.IconDisplayStyle,'off');
51 38 end
51 39 end
51 40 end
41
51 42 if res && ~feature('HGUsingMATLABClasses')
51 43 res = hasbehavior(h,'legend');
51 44 end

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