This is a static copy of a profile reportHome
legendcolorbarlayout>doBestLegendLayout (9 calls, 0.503 sec)
Generated 05-Aug-2011 13:02:42 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/legendcolorbarlayout.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 |
1159 | pos = methods(handle(h),'get_b... | 9 | 0.492 s | 97.8% |  |
1169 | set(h,'Position',pos); | 9 | 0.011 s | 2.2% |  |
1171 | setappdata(ax,'inLayout',oldla... | 9 | 0 s | 0% |  |
1170 | end | 9 | 0 s | 0% |  |
1168 | setappdata(double(h),'LegendBe... | 9 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.503 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 16 |
Non-code lines (comments, blank lines) | 2 |
Code lines (lines that can run) | 14 |
Code lines that did run | 14 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1156 function doBestLegendLayout(ax,h)
9 1157 oldlayout = getappdata(ax,'inLayout');
9 1158 setappdata(ax,'inLayout',true);
0.49 9 1159 pos = methods(handle(h),'get_best_location');
9 1160 if ~any(isnan(pos)) && all(pos(3:4) > 0)
9 1161 normpos = pos;
9 1162 pos = hgconvertunits(ancestor(ax,'figure'),pos,...
1163 'normalized',get(h,'Units'),get(ax,'Parent'));
9 1164 axpos = get(ax,'Position');
9 1165 fig = ancestor(ax,'figure');
9 1166 axpos = hgconvertunits(fig,axpos,get(ax,'Units'),'normalized',get(ax,'Parent'));
9 1167 bestpt = (normpos(1:2)-axpos(1:2))./axpos(3:4);
9 1168 setappdata(double(h),'LegendBestLocation',bestpt);
0.01 9 1169 set(h,'Position',pos);
9 1170 end
9 1171 setappdata(ax,'inLayout',oldlayout);
Other subfunctions in this file are not included in this listing.