This is a static copy of a profile reportHome
legendcolorbarlayout>localGetYLabelWidth (172 calls, 0.066 sec)
Generated 05-Aug-2011 13:02:35 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 |
745 | if ~isprop(yLab,'CachedPositio... | 170 | 0.055 s | 83.3% |  |
750 | pixBounds = get(yLab,'PixelBou... | 151 | 0.011 s | 16.7% |  |
755 | width = width(3); | 151 | 0 s | 0% |  |
754 | width = hgconvertunits(hFig,[0... | 151 | 0 s | 0% |  |
753 | hFig = ancestor(ax,'Figure'); | 151 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.066 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
isprop | function | 170 | 0.033 s | 50.0% |  |
is2D | function | 172 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.033 s | 50.0% |  |
Totals | | | 0.066 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 18 |
Code lines that did run | 13 |
Code lines that did not run | 5 |
Coverage (did run/can run) | 72.22 % |
Function listing
time calls line
730 function width = localGetYLabelWidth(ax,units)
731 % Returns the height (in the units specified) of an axes YLabel.
732
733 % If we are not a 2-D axes, return early
172 734 if ~is2D(ax)
735 width = 0;
736 return;
737 end
738
172 739 yLab = get(ax,'YLabel');
172 740 if isempty(get(yLab,'String'))
2 741 width = 0;
2 742 return;
743 end
744 % If the label is in "manual" mode, don't use it in computations:
0.05 170 745 if ~isprop(yLab,'CachedPosition') || ...
746 ~isequal(get(yLab,'CachedPosition'),get(yLab,'Position'))
19 747 width = 0;
19 748 return;
749 end
0.01 151 750 pixBounds = get(yLab,'PixelBounds');
751 % Add a small offset to keep things nice
151 752 leftChange = pixBounds(3) - pixBounds(1) + 10;
151 753 hFig = ancestor(ax,'Figure');
151 754 width = hgconvertunits(hFig,[0 0 leftChange 0],'Pixels',units,get(ax,'Parent'));
151 755 width = width(3);
Other subfunctions in this file are not included in this listing.