This is a static copy of a profile reportHome
legendcolorbarlayout>getPixelBounds (165 calls, 0.350 sec)
Generated 05-Aug-2011 13:02:45 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 |
659 | bottomChange = localGetXLabelH... | 165 | 0.109 s | 31.2% |  |
650 | leftChange = localGetYLabelWid... | 165 | 0.066 s | 18.7% |  |
669 | topChange = localGetTitleHeigh... | 165 | 0.055 s | 15.6% |  |
641 | p = topixels(ax,[corner1; corn... | 130 | 0.033 s | 9.4% |  |
661 | if strcmpi(get(ax,'XAxisLocati... | 165 | 0.011 s | 3.1% |  |
All other lines | | | 0.077 s | 21.9% |  |
Totals | | | 0.350 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 39 |
Non-code lines (comments, blank lines) | 7 |
Code lines (lines that can run) | 32 |
Code lines that did run | 28 |
Code lines that did not run | 4 |
Coverage (did run/can run) | 87.50 % |
Function listing
time calls line
633 function [corner1,corner2] = getPixelBounds(ax,textObjects,withPixBounds)
0.01 165 634 corner1 = get(textObjects(1),'PixelBounds');
165 635 corner2 = get(textObjects(2),'PixelBounds');
165 636 if ~withPixBounds || all(corner1 == 0) || all(corner2 == 0)
0.01 130 637 opos = get(textObjects,'Position');
0.01 130 638 set(textObjects,'Units','data');
0.01 130 639 corner1 = get(textObjects(1),'Position');
0.01 130 640 corner2 = get(textObjects(2),'Position');
0.03 130 641 p = topixels(ax,[corner1; corner2]);
0.01 130 642 set(textObjects,'Units','normalized');
0.01 130 643 set(textObjects,{'Position'},opos);
130 644 corner1 = [p(1,:) p(1,:)];
130 645 corner2 = [p(2,:) p(2,:)];
130 646 end
647
648 % The text objects do not take the XLabel or YLabels into account. Add an
649 % offset for the X-Label and Y-Label for the bottom left corner.
0.07 165 650 leftChange = localGetYLabelWidth(ax,'Pixels');
651 % If the Y-axis is on the right, change the top right corner
165 652 if strcmpi(get(ax,'YAxisLocation'),'Right')
653 corner2(1) = corner2(1) + leftChange;
654 corner2(3) = corner2(3) + leftChange;
165 655 else % Otherwise change the bottom left corner
165 656 corner1(1) = corner1(1) - leftChange;
165 657 corner1(3) = corner1(3) - leftChange;
165 658 end
0.11 165 659 bottomChange = localGetXLabelHeight(ax,'Pixels');
660 % If the X-axis is on top, change the top right corner
0.01 165 661 if strcmpi(get(ax,'XAxisLocation'),'Top')
662 corner2(2) = corner2(2) - bottomChange;
663 corner2(4) = corner2(4) - bottomChange;
165 664 else % Otherwise change the bottom left corner
165 665 corner1(2) = corner1(2) + bottomChange;
165 666 corner1(4) = corner1(4) + bottomChange;
165 667 end
668 % We also need to deal with titles;
0.05 165 669 topChange = localGetTitleHeight(ax,'Pixels');
165 670 corner2(2) = corner2(2) - topChange;
165 671 corner2(4) = corner2(4) - topChange;
Other subfunctions in this file are not included in this listing.