This is a static copy of a profile reportHome
imuitools\private\figparams (1 call, 0.063 sec)
Generated 15-Mar-2007 12:02:05 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\images\imuitools\private\figparams.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 |
23 | hfig = figure('Visible', 'off'... | 1 | 0.031 s | 49.9% |  |
66 | title_extent = get(htitle, 'Ex... | 1 | 0.016 s | 25.0% |  |
53 | set(hfig, 'Position', [fig_pos... | 27 | 0.016 s | 25.0% |  |
67 | p.AxesTitleHeight = 2 * (title... | 1 | 0.000 s | 0.0% |  |
73 | p.YLabelWidth = -1.8 * (ylabel... | 1 | 0.000 s | 0.0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.063 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
close | M-function | 1 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.063 s | 99.9% |  |
Totals | | | 0.063 s | 100% | |
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in file | 90 |
Non-code lines (comments, blank lines) | 41 |
Code lines (lines that can run) | 49 |
Code lines that did run | 44 |
Code lines that did not run | 5 |
Coverage (did run/can run) | 89.80 % |
Function listing
time calls line
1 function out = figparams
2 %FIGPARAMS Calculate figure parameters.
3 % OUT = FIGPARAMS calculates absolute figure parameters that can be
4 % used in laying out axes positions.
5 %
6 % The parameters that determine these dimensions only need to be computed
7 % once per MATLAB session because they are independent of the image being
8 % displayed and depend on the machine running the display function.
9
10 % Copyright 1993-2004 The MathWorks, Inc.
11 % $Revision: 1.1.8.1 $ $Date: 2004/08/10 01:50:05 $
12
13
14 % lock file as this should only be calculated once per MATLAB session
1 15 mlock
16
1 17 persistent p
1 18 if ~isempty(p)
19 out = p;
20 return
21 end
22
0.03 1 23 hfig = figure('Visible', 'off', 'IntegerHandle', 'off', 'Units', 'pixels');
1 24 hax = axes('Parent', hfig, 'Units', 'pixels', ...
25 'XAxisLocation', 'bottom', 'YAxisLocation', 'left');
26
1 27 ax_pos = get(hax, 'Position');
1 28 fig_pos = get(hfig, 'Position');
1 29 fig_outer_pos = get(hfig, 'OuterPosition');
30
31 % Decorations are the titlebar, toolbars, menu bars, and the edges of
32 % figure windows. Really, just the difference between the 'Position' and
33 % the 'OuterPosition.'
34 %
35 % Note: The calculation of the 'OuterPosition' is platform dependent and
36 % there have been bugs on certain platforms.
1 37 p.LeftDecoration = abs(fig_pos(3) - fig_outer_pos(3))/2;
1 38 p.BottomDecoration = p.LeftDecoration;
1 39 p.RightDecoration = p.LeftDecoration;
< 0.01 1 40 p.TopDecoration = fig_outer_pos(4) - fig_pos(4) - p.BottomDecoration + ...
41 60; % fudge factor to account for menus and toolbar which seem to not
42 % be part of figure OuterPosition.
43
1 44 set(hax,'YLim',[1 1000]); % So tick labels will fit for images with
45 % 1000s of pixels in either dimension.
46
47 % Empirically find the MinFigWidth by trying to shrink figure.
< 0.01 1 48 width = fig_pos(3);
< 0.01 1 49 original_outer_height = fig_outer_pos(4);
< 0.01 1 50 outer_height = original_outer_height;
1 51 while (width > 20) && (outer_height == original_outer_height)
< 0.01 27 52 width = width - 20;
0.02 27 53 set(hfig, 'Position', [fig_pos(1:2) width fig_pos(4)]);
27 54 new_outer_pos = get(hfig, 'OuterPosition');
< 0.01 27 55 outer_height = new_outer_pos(4);
27 56 end
< 0.01 1 57 p.MinFigWidth = width + 20;
58
1 59 htitle = get(hax, 'title');
1 60 hxlabel = get(hax, 'xlabel');
1 61 hylabel = get(hax, 'ylabel');
62
1 63 set([htitle hxlabel hylabel], 'Units', 'pixels', 'String', 'X');
64
65 % premultipliers are tuned to "look good" for most image sizes
0.02 1 66 title_extent = get(htitle, 'Extent');
< 0.01 1 67 p.AxesTitleHeight = 2 * (title_extent(2) + title_extent(4)/2 - ax_pos(4));
68
1 69 xlabel_extent = get(hxlabel, 'Extent');
< 0.01 1 70 p.XLabelHeight = -2 * (xlabel_extent(2) + xlabel_extent(4)/2);
71
1 72 ylabel_extent = get(hylabel, 'Extent');
< 0.01 1 73 p.YLabelWidth = -1.8 * (ylabel_extent(1) + ylabel_extent(3)/2);
74
1 75 close(hfig);
76
1 77 screen_units = get(0, 'Units');
1 78 set(0, 'Units', 'pixels');
1 79 screen_size = get(0, 'ScreenSize');
1 80 set(0, 'Units', screen_units);
81
1 82 if any(screen_size(3:4) <= 1)
83 p.ScreenWidth = 10000;
84 p.ScreenHeight = 10000;
< 0.01 1 85 else
< 0.01 1 86 p.ScreenWidth = screen_size(3);
< 0.01 1 87 p.ScreenHeight = screen_size(4);
< 0.01 1 88 end
89
1 90 out = p;