Set or queryx-axis limits
xlim(limits)
xl = xlim
xlim auto
xlim manual
m = xlim('mode')
___= xlim(ax,___)
xlim(
sets thex-axis limits for the current axes. Specifylimits
)limits
as a two-element vector of the form[xmin xmax]
, wherexmax
is greater thanxmin
.
xlim auto
sets an automatic mode, enabling the axes to determine thex-axis limits. The limits span the range of the plotted data. Use this option if you change the limits and then want to set them back to the default values. This command sets theXLimMode
property for the axes to'auto'
.
xlim manual
sets a manual mode, freezing the limits at the current values. Use this option if you want to retain the current limits when adding new data to the axes using thehold on
command. This command sets theXLimMode
property for the axes to“手动”
.
returns the currentx-axis limits mode, which is eitherm
= xlim('mode')'auto'
or“手动”
. By default, the mode is automatic unless you specify limits or set the mode to manual.
___= xlim(
uses the axes specified byax
,___)ax
instead of the current axes. Specifyax
as the first input argument for any of the previous syntaxes. You can include an output argument if the original syntax supports an output argument. Use single quotes around input arguments that are character vectors, for example,xlim(ax,'auto')
.