axis的用法
转载自:https://www.cnblogs.com/10439-y/p/11788979.html
其他参考:https://ww2.mathworks.cn/help/matlab/ref/axes.html?s_tid=srchtitle
https://ww2.mathworks.cn/help/matlab/ref/matlab.graphics.axis.axes-properties.html
https://www.cnblogs.com/stxs/p/8721348.html
https://www.cnblogs.com/stxs/p/8617140.html
-
axis([xmin xmax ymin ymax]): [ ]中分别给出x轴和y轴的最大值、最小值。( sets scaling for the x- and y-axes on the current plot.)
-
axis([xmin xmax ymin ymax zmin zmax]):[ ]中分别给出x轴、y轴、z轴的最大值、最小值。(sets the scaling for the x-, y- and z-axes on the current 3-D plot)
-
axis equal 或axis(‘equal’) :表示x轴和y轴的单位长度相同。(sets the aspect ratio so that equal tick mark increments on the x-,y- and z-axis are equal in size)
-
axis square 或 axis(‘square’): 显示的坐标系呈正方形。(makes the current axis box square in size.)
-
axis off 或 axis(‘off’) :关闭所有坐标轴线、刻度标记和标签。(turns off all axis labeling, tick marks and background)
-
axis auto:基于x、y和z的最大值和最小值来自动设置坐标轴的范围。用户可以只限定某一个坐标轴,如:axis 'auto x'用来限定x轴的范围;axis 'auto yz'用来限定y轴和z轴的范围。(returns the axis scaling to its default, automatic mode where,for each dimension, 'nice' limits are chosen based on the extents of all line, surface, patch, and image children.)
-
axis manual:将坐标轴的范围锁定为当前范围。如果打开了hold on命令,则后续的图形都使用同样的坐标范围。该函数设置XLimMode、YLimMode和ZLimMode属性为manual值。(freezes the scaling at the current limits, so that if HOLD is turned on, subsequent plots will use the same limits.)
-
axis tight:设置坐标轴的范围为数据的范围。(sets the axis limits to the range of the data.)
-
axis fill:设置坐标轴的范围以及PlotBoxAspectRatio属性。坐标轴将填充整个矩形局域。只有PlotBoxAspectRatioMode或DataAspectRatioMode属性值为 manual时,该方法才起作用。(sets the axis limits and PlotBoxAspectRatio so that the axis fills the position rectangle.)
-
a xis ij:将坐标系的原点设置到左上角。i轴为垂直轴,正方向为从上到下。j轴为水平轴,正方向为从左到右。(puts MATLAB into its "matrix" axes mode. The coordinate system origin is at the upper left corner. The i axis is vertical and is numbered from top to bottom. The j axis is horizontal and is numbered from left to right.)
-
axis xy:在默认的笛卡尔坐标系中绘制图形,坐标系的原点在左下角。x轴为水平坐标轴,正方向为从左到右;y轴为垂直坐标轴,正方向为从下到上。(puts MATLAB into its default "Cartesian" axes mode. The coordinate system origin is at the lower left corner. The x axis is horizontal and is numbered from left to right. The y axis is vertical and is numbered from bottom to top.)
-
axis on:关闭所有坐标轴线、刻度标记和标签。( turns axis labeling, tick marks and background back on)
-
axis image:功能与axis equal相同。只不过坐标轴的边框紧贴在数据的四轴。多用来显示图片。(is the same as AXIS EQUAL except that the plot box fits tightly around the data.)
-
axis normal:自动调节坐标轴的纵横比,从而是图形随窗口的形状而改变.(restores the current axis box to full size and removes any restrictions on the scaling of the units.This undoes the effects of AXIS SQUARE and AXIS EQUAL)
-
v=axis:返回一个行向量,向量中的元素包含x、y和z轴的刻度因子。v具有四个或六个元素,这取决于当前坐标轴是二维的还是三维的。返回值是当前坐标轴的XLim、YLim和ZLim属性的值。(returns a row vector containing the scaling for the current plot. If the current view is 2-D, V has four components; if it is 3-D, V has six components.)
-
axis Vis3D:锁定坐标轴的纵横比.(freezes aspect ratio properties to enable rotation of 3-D objects and overrides stretch-to-fill.)
axis equal 用法--参考:https://zhidao.baidu.com/question/233490313.html
解释:matlab函数图象很多时候为了把x和y的信息都表达得充分明显,会使x轴单位的实际长度和y轴单位的实际长度不一样。
有利作用:比如说,y=0.00001*sin(x),系统就会自动拉长y轴来放大变化,方便我们看得清图象的函数变化。axis equal就是取消这种变化。把单位长度都变的一样。这样做的好处就是对于圆来说更像圆,
弊端:但是对于一些变化很微小的函数就不是很直观,例如y=0.00000001* sin(x)看起来就有点像一条直线了