This is a static copy of a profile reportHome
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)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
9 | if ismethod(h,'islegendable') | 51 | 0.087 s | 80.0% |  |
17 | if ( (isempty(get(h,'xdata')) ... | 51 | 0.022 s | 20.0% |  |
44 | end | 51 | 0 s | 0% |  |
43 | res = hasbehavior(h,'legend'); | 51 | 0 s | 0% |  |
42 | if res && ~feature('HG... | 51 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.109 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 44 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 29 |
Code lines that did run | 17 |
Code lines that did not run | 12 |
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.