This is a static copy of a profile reportHome
axis (6 calls, 0.426 sec)
Generated 05-Aug-2011 13:03:26 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graph2d/axis.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
genfigLoad | function | 6 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
94 | LocSetLimits(ax(j),cur_arg); | 6 | 0.393 s | 92.3% |  |
69 | if length(ax)==1 && is... | 6 | 0.011 s | 2.6% |  |
189 | if nargout > 0 && ~... | 6 | 0 s | 0% |  |
187 | end | 6 | 0 s | 0% |  |
186 | end | 6 | 0 s | 0% |  |
All other lines | | | 0.022 s | 5.1% |  |
Totals | | | 0.426 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
axis>LocSetLimits | subfunction | 6 | 0.393 s | 92.3% |  |
gcf | function | 6 | 0 s | 0% |  |
axis>allAxes | subfunction | 6 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.033 s | 7.7% |  |
Totals | | | 0.426 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 191 |
Non-code lines (comments, blank lines) | 119 |
Code lines (lines that can run) | 72 |
Code lines that did run | 18 |
Code lines that did not run | 54 |
Coverage (did run/can run) | 25.00 % |
Function listing
time calls line
1 function [ans1, ans2, ans3] = axis(varargin)
2 %AXIS Control axis scaling and appearance.
3 % AXIS([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes
4 % on the current plot.
5 % AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX]) sets the scaling for the
6 % x-, y- and z-axes on the current 3-D plot.
7 % AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX CMIN CMAX]) sets the
8 % scaling for the x-, y-, z-axes and color scaling limits on
9 % the current axis (see CAXIS).
10 % V = AXIS returns a row vector containing the scaling for the
11 % current plot. If the current view is 2-D, V has four
12 % components; if it is 3-D, V has six components.
13 %
14 % AXIS AUTO returns the axis scaling to its default, automatic
15 % mode where, for each dimension, 'nice' limits are chosen based
16 % on the extents of all line, surface, patch, and image children.
17 % AXIS MANUAL freezes the scaling at the current limits, so that if
18 % HOLD is turned on, subsequent plots will use the same limits.
19 % AXIS TIGHT sets the axis limits to the range of the data.
20 % AXIS FILL sets the axis limits and PlotBoxAspectRatio so that
21 % the axis fills the position rectangle. This option only has
22 % an effect if PlotBoxAspectRatioMode or DataAspectRatioMode are
23 % manual.
24 %
25 % AXIS IJ puts MATLAB into its "matrix" axes mode. The coordinate
26 % system origin is at the upper left corner. The i axis is
27 % vertical and is numbered from top to bottom. The j axis is
28 % horizontal and is numbered from left to right.
29 % AXIS XY puts MATLAB into its default "Cartesian" axes mode. The
30 % coordinate system origin is at the lower left corner. The x
31 % axis is horizontal and is numbered from left to right. The y
32 % axis is vertical and is numbered from bottom to top.
33 %
34 % AXIS EQUAL sets the aspect ratio so that equal tick mark
35 % increments on the x-,y- and z-axis are equal in size. This
36 % makes SPHERE(25) look like a sphere, instead of an ellipsoid.
37 % AXIS IMAGE is the same as AXIS EQUAL except that the plot
38 % box fits tightly around the data.
39 % AXIS SQUARE makes the current axis box square in size.
40 % AXIS NORMAL restores the current axis box to full size and
41 % removes any restrictions on the scaling of the units.
42 % This undoes the effects of AXIS SQUARE and AXIS EQUAL.
43 % AXIS VIS3D freezes aspect ratio properties to enable rotation of
44 % 3-D objects and overrides stretch-to-fill.
45 %
46 % AXIS OFF turns off all axis labeling, tick marks and background.
47 % AXIS ON turns axis labeling, tick marks and background back on.
48 %
49 % AXIS(H,...) changes the axes handles listed in vector H.
50 %
51 % See also AXES, GRID, SUBPLOT, XLIM, YLIM, ZLIM.
52
53 % Copyright 1984-2007 The MathWorks, Inc.
54 % $Revision: 5.49.4.11 $ $Date: 2010/03/31 18:23:48 $
55
56 %get the list of axes to operate upon
6 57 if ~isempty(varargin) && allAxes(varargin{1})
58
59 ax = varargin{1};
60 varargin=varargin(2:end);
6 61 else
6 62 ax = gca;
6 63 end
64
6 65 ans1set = false;
6 66 pbarlimit = 0.1;
67
68 %---Check for bypass option (only supported for single axes)
0.01 6 69 if length(ax)==1 && isappdata(ax,'MWBYPASS_axis')
70 if isempty(varargin)
71 ans1 = mwbypass(ax,'MWBYPASS_axis');
72 ans1set = true;
73 else
74 mwbypass(ax,'MWBYPASS_axis',varargin{:});
75 end
6 76 elseif isempty(varargin)
77 if length(ax)==1
78 ans1=LocGetLimits(ax);
79 ans1set = true;
80 else
81 ans1=cell(length(ax),1);
82 ans1set = true;
83 for i=1:length(ax)
84 ans1{i}=LocGetLimits(ax(i));
85 end
86 end
6 87 else
6 88 for j=1:length(ax)
6 89 for i = 1:length(varargin)
6 90 cur_arg = varargin{i};
91
92 % Set limits manually with 4/6/8 element vector
6 93 if isnumeric(cur_arg)
0.39 6 94 LocSetLimits(ax(j),cur_arg);
95
96 % handle AUTO, AUTO[XYZ]:
97 elseif strcmp(cur_arg(1:min(4,length(cur_arg))),'auto')
98 LocSetAuto(ax(j),cur_arg);
99
100 % handle TIGHT
101 elseif(strcmp(cur_arg,'tight'))
102 LocSetTight(ax(j));
103
104 % handle FILL:
105 elseif(strcmp(cur_arg, 'fill'))
106 LocSetFill(ax(j),pbarlimit);
107
108 % handle MANUAL:
109 elseif(strcmp(cur_arg, 'manual'))
110 set(ax(j),...
111 'XLimMode','manual',...
112 'YLimMode','manual',...
113 'ZLimMode','manual');
114
115 % handle IJ:
116 elseif(strcmp(cur_arg, 'ij'))
117 set(ax(j),...
118 'XDir','normal',...
119 'YDir','reverse');
120
121 % handle XY:
122 elseif(strcmp(cur_arg, 'xy'))
123 set(ax(j),...
124 'XDir','normal',...
125 'YDir','normal');
126
127 % handle SQUARE:
128 elseif(strcmp(cur_arg, 'square'))
129 set(ax(j),...
130 'PlotBoxAspectRatio',[1 1 1],...
131 'DataAspectRatioMode','auto')
132
133 % handle EQUAL:
134 elseif(strcmp(cur_arg, 'equal'))
135 LocSetEqual(ax(j),pbarlimit);
136
137 % handle IMAGE:
138 elseif(strcmp(cur_arg,'image'))
139 LocSetImage(ax(j),pbarlimit);
140
141 % handle NORMAL:
142 elseif(strcmp(cur_arg, 'normal'))
143 set(ax(j),...
144 'PlotBoxAspectRatioMode','auto', ...
145 'DataAspectRatioMode' ,'auto', ...
146 'CameraViewAngleMode' ,'auto');
147
148 % handle OFF:
149 elseif(strcmp(cur_arg, 'off'))
150 set(ax(j),'Visible','off');
151 set(get(ax(j),'Title'),'Visible','on');
152
153 % handle ON:
154 elseif(strcmp(cur_arg, 'on'))
155 set(ax(j),'Visible','on');
156
157 % handle VIS3D:
158 elseif(strcmp(cur_arg,'vis3d'))
159 set(ax(j),...
160 'CameraViewAngle', get(ax(j),'CameraViewAngle'),...
161 'DataAspectRatio', get(ax(j),'DataAspectRatio'),...
162 'PlotBoxAspectRatio',get(ax(j),'PlotBoxAspectRatio'));
163
164 % handle STATE:
165 elseif(strcmp(cur_arg, 'state'))
166 warning('MATLAB:graph2d:axis:ObsoleteState',(['AXIS(''STATE'') is obsolete and', ...
167 ' will be eliminated\n in future versions.', ...
168 ' Use GET(GCA,...) instead.']));
169 %note that this will keep overwriting arg1 etc if there is more
170 %than one axes in the list
171 [ans1,ans2,ans3]=LocGetState(ax(1));
172 ans1set = true;
173
174 %if nargout>1
175 % ans2=ans2q;
176 % if nargout>2
177 % ans3=ans3q;
178 % end
179 %end
180
181 % handle ERROR (NONE OF THE ABOVE STRINGS FOUND):
182 else
183 error('MATLAB:axis:UnknownOption', 'Unknown command option %s', cur_arg);
184 end
6 185 end
6 186 end
6 187 end
188
6 189 if nargout > 0 && ~ans1set
190 error(nargoutchk(0, 0, nargout));
191 end
Other subfunctions in this file are not included in this listing.