matlab语句xlim,matlab中设置坐标轴时xlim和axis有什么区别?

两个都可以定义坐标轴:

xlim是用来定义x轴的,具体使用方法见matlab帮助文档

help xlim

XLIM X limits.

XL = XLIM gets the x limits of the current axes.

XLIM([XMIN XMAX]) sets the x limits.

XLMODE = XLIM('mode') gets the x limits mode.

XLIM(mode) sets the x limits mode.

(mode can be 'auto' or 'manual')

XLIM(AX,...) uses axes AX instead of current axes.

XLIM sets or gets the XLim or XLimMode property of an axes.

See also pbaspect, daspect, ylim, zlim.

axis是用来定义坐标轴的,包括x轴y轴z轴,具体使用方法见帮助文档

help axis

AXIS Control axis scaling and appearance.

AXIS([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes

on the current plot.

AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX]) sets the scaling for the

x-, y- and z-axes on the current 3-D plot.

AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX CMIN CMAX]) sets the

scaling for the x-, y-, z-axes and color scaling limits on

the current axis (see CAXIS).

V = AXIS 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 AUTO 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 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 sets the axis limits and PlotBoxAspectRatio so that

the axis fills the position rectangle. This option only has

an effect if PlotBoxAspectRatioMode or DataAspectRatioMode are

manual.

AXIS IJ 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 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 EQUAL sets the aspect ratio so that equal tick mark

increments on the x-,y- and z-axis are equal in size. This

makes SPHERE(25) look like a sphere, instead of an ellipsoid.

AXIS IMAGE is the same as AXIS EQUAL except that the plot

box fits tightly around the data.

AXIS SQUARE makes the current axis box square in size.

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.

AXIS VIS3D freezes aspect ratio properties to enable rotation of

3-D objects and overrides stretch-to-fill.

AXIS OFF turns off all axis labeling, tick marks and background.

AXIS ON turns axis labeling, tick marks and background back on.

AXIS(H,...) changes the axes handles listed in vector H.

See also axes, grid, subplot, xlim, ylim, zlim.

总之,当你只需要定义x轴的坐标范围时,就用xlim,函数不涉及其他参数,比较简单好记;

当你需要同时定义x轴y轴z轴的坐标范围时,就用axis,一气呵成,比较方便。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值