This is a static copy of a profile reportHome
scribe/private/islegendable (372 calls, 0.238 sec)
Generated 18-Mar-2011 23:32:04 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/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 |
11 | if ( (isempty(get(h,'xdata')) ... | 372 | 0.073 s | 30.4% |  |
41 | res = hasbehavior(h,'legend'); | 372 | 0.062 s | 26.1% |  |
9 | switch get(h,'Type') | 372 | 0.041 s | 17.4% |  |
40 | if res | 372 | 0.010 s | 4.3% |  |
37 | end | 372 | 0.010 s | 4.3% |  |
All other lines | | | 0.041 s | 17.4% |  |
Totals | | | 0.238 s | 100% | |
Children (called functions)
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 42 |
Non-code lines (comments, blank lines) | 13 |
Code lines (lines that can run) | 29 |
Code lines that did run | 16 |
Code lines that did not run | 13 |
Coverage (did run/can run) | 55.17 % |
Function listing
time calls line
1 function res=islegendable(h,includeImages)
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-2007 The MathWorks, Inc.
7
0.01 372 8 res= true;
0.04 372 9 switch get(h,'Type')
372 10 case {'line','patch','surface'}
0.07 372 11 if ( (isempty(get(h,'xdata')) || isallnan(get(h,'xdata'))) && ...
12 (isempty(get(h,'ydata')) || isallnan(get(h,'ydata'))) && ...
13 (isempty(get(h,'zdata')) || isallnan(get(h,'zdata'))) ) || ...
14 ~hasbehavior(h,'legend')
15 res = false;
16 end
17 case {'hggroup','hgtransform'}
18 if isempty(get(h,'Children'))
19 res = false;
20 end
21 case {'image'}
22 if ~includeImages || ~hasbehavior(h,'legend')
23 res = false;
24 end
25 otherwise
26 res = false;
27 end
28
29 % Take the "LegendEntry" display property into account.
372 30 if res
0.01 372 31 hA = get(h,'Annotation');
372 32 if ishandle(hA)
372 33 hL = hA.LegendInformation;
0.01 372 34 if ishandle(hL)
372 35 res = ~strcmpi(hL.IconDisplayStyle,'off');
372 36 end
0.01 372 37 end
372 38 end
39
0.01 372 40 if res
0.06 372 41 res = hasbehavior(h,'legend');
372 42 end
Other subfunctions in this file are not included in this listing.