EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x

2 t9 e% ~6 N& L- M

ylim" {1 I6 t9 a  ]. {9 z

设置或查询 y 轴限制1 M9 R2 d1 @0 F: l' ^2 Q7 Y

9 d7 s, @$ x, V8 F- u

Syntax

! b0 Q: d0 U& u7 I; u

3 F# A% n- J/ h  V7 f1 o: Cylim(limits)

% x, E- s! {% E8 G) L2 F$ }4 H, a. e# t; B. k! ~

yl = ylim0 @  `3 l* A' x( c

7 s1 {( p5 F6 C  ~2 Z8 z; E0 e7 o

ylim auto+ ~, N3 _; g; m: M; y

; s  X. w5 r( o. y1 ~6 Z3 Q' @

ylim manual1 ]- I* Q7 ]4 p7 O! n9 K) Y5 i! q: i

/ c0 I  `9 ^. k( j) k! T; u9 Im = ylim('mode')- [0 U; S; U; Y

; q/ S8 h5 i) H) u1 U" P7 g6 d/ H

___ = ylim(target,___)

2 i) K3 @. l  x) e8 t3 Q9 H9 b2 Q4 P# f# C* h: ^3 d5 n! P1 G( E

' T; @0 [- s+ R. P

Description) i6 P- P) f- P$ r1 e

7 m' L- N+ @. H( ?

ylim(limits) 设置当前坐标轴或图表的 y 轴限制。将限制指定为窗体的两个元素向量 [ymin ymax], 其中 ymax 大于 ymin。

, f. G& I, L% @5 s* ?- s, V3 `  H: h2 }0 P+ m

例子:3 n0 d! O" {" J( F4 ~$ w

1 P% g3 n/ N1 r! ], t

Plot a line and set the y-axis limits to range from -2 to 2.% `* i  S+ V# W' @4 A! L, u$ f+ d

q* {" g, t( }7 yx = linspace(0,10);

y = sin(x);

plot(x,y)

ylim([-2 2])( V9 ^. j5 p# }7 r; [

% e1 e. O8 Q2 H! F# [( w3 J

zlim的简单介绍-10.png (18.74 KB, 下载次数: 0)

2019-12-28 09:32 上传

0 n  S: D7 u+ a( q6 O! @* t& { ! \5 U: V; Y+ l: c& s

4 j: }9 B0 d* R. P/ Kyl = ylim  将当前限制返回为两个元素向量。

5 ^- L+ g: d9 k/ v, g) E. Q

1 U6 s6 D6 B2 g; x例子:

- x8 I2 b% |6 h, q+ }% F% A' {2 [4 _3 P4 x

创建随机数据的散点图。返回 y 轴限制的值。) u* }4 L7 j8 ^: u) l" @

4 @; U! C: ?/ N  o3 c* U

x = randn(50,1);

y = randn(50,1);

scatter(x,y)

' i& c. w/ ?/ H1 c& C  n1 W

( {2 h9 F# G$ A4 Z0 I# j

zlim的简单介绍-9.png (21.8 KB, 下载次数: 0)

2019-12-28 09:32 上传

J1 L# w2 i2 p8 w* l3 A# v% {1 t

, s) V" Y1 d( |: a" w$ z( K0 w0 ]# ^

3 T% o9 }  N7 ?, c! [& {) y

ylim auto 设置自动模式, 使轴能够确定 y 轴限制。限制跨越绘制数据的范围。如果更改限制, 然后希望将其设置回默认值, 请使用此选项。此命令将轴的 YLimMode 属性设置为 "auto"。

+ W$ [$ y' c0 c3 `

/ {' f  m! ~! M! w( nylim manual 设置手动模式, 冻结当前值的限制。如果要在使用 thehold 命令将新数据添加到坐标轴时保留当前限制, 请使用此选项。此命令将轴的 YLimMode 属性设置为 "手动"。

# K: [9 ?( z/ s1 `8 V! ^+ V& k0 s& @& d7 U- N$ \

例子:Maintain Current y-Axis Limits

E8 m7 ~  Q4 u& @3 G8 i  C4 ]* z; D, D, O; [1 N

First, plot a line.8 Y8 _- k; l: ~, ]0 {8 w

1 O, \7 R8 a, \5 v# w1 Lx = linspace(0,10);

y = sin(x);

plot(x,y)

+ P. d) a$ R# Y, S& E" Q' h  Q

$ c- q: y) n* X( s

zlim的简单介绍-8.png (22.62 KB, 下载次数: 0)

2019-12-28 09:32 上传

8 e( ^9 b& `5 i, f- j

{" R/ A+ G; @9 b. X" l& W  E: t: M7 v

Set the y-axis limits mode to manual so that the limits to not change. Use hold on to add a second plot to the axes.; y. _. E7 H% Q" z

$ x+ ]! G! c6 O% k4 n2 ~9 x

ylim manual

hold on

y2 = 2*sin(x);

plot(x,y2)

hold off

$ S, S2 s! S* V& @; Z2 @% v' s: l1 b# m: l5 r; j# R+ l

zlim的简单介绍-7.png (26.37 KB, 下载次数: 0)

2019-12-28 09:32 上传

/ U& ]2 f! y; T  x9 ]* C; y

/ D# a9 Q, W, l9 T' |5 i( ~! a8 I: K; G0 _% _5 T

The y-axis limits do not update to incorporate the new plot., ^8 h$ Q. b$ D* W+ W

. r) P" u: J: t, F3 J

Switch back to automatically updated limits by resetting the mode to automatic.

1 R0 [, E0 W' B6 c* T1 K8 z0 a

- C  L8 n7 X; I4 D& n+ o& wylim auto3 I8 l# S* E/ D

' V9 @; A. r! O1 s# l

zlim的简单介绍-6.png (24.74 KB, 下载次数: 0)

2019-12-28 09:32 上传

; F" F& D  k; [) k8 p0 k

# Z3 f* y2 R' W- o: Q

( V3 U  Q; |# Km = ylim ("mode") 返回当前的 y 轴限制模式, 即 "auto" 或 "manual"。默认情况下, 除非您指定限制或将模式设置为manual, 否则模式是auto。6 q: [# P% B7 C6 w3 i; q

6 r& o8 |/ `( Y

___ = ylim(target,___) 使用由目标指定的轴或图表, 而不是当前坐标轴。将目标指定为以前任何语法的第一个输入参数。如果原始语法支持输出参数, 则可以包括输出参数。在模式输入周围使用单引号, 例如, ylim (target , "auto")。

! d- M& X2 t& ~$ k+ M/ o0 `+ y" g

8 M- m4 E" j9 j1 y4 a' z, |$ x6 L例子:

9 H8 ]+ J  @' B+ h* \

; x" A8 A% l1 v0 o8 yCreate a figure with two subplots and assign the Axes objects to the variables ax1 and ax2. Plot the same data in each subplot. Set the y-axis limits for the bottom subplot by specifying ax2 as the first input to ylim.

t) F) W1 A, n' a) \, N9 d. e2 F9 O  i6 f. j

创建一副拥有两个子图的图像,并把 Axes对象赋值给两个变量 ax1和ax2。在两幅子图中画同样的数据。通过将 ax2 指定为 ylim 的第一个输入, 为底部子图设置 y 轴限制。& E/ r6 s7 W6 K

( _9 P, X) m. z+ G9 Jclc

clear

close all

x = linspace(0,10,1000);

y = sin(10*x).*exp(.5*x);

ax1 = subplot(2,1,1);

plot(x,y)

ax2 = subplot(2,1,2);

plot(x,y)

ylim(ax2,[-10 10])

: O. D: j" i5 @( T) a3 i, ]2 f' g

: |  E# o) s9 D+ g; c. D, C0 T

zlim的简单介绍-5.png (27.7 KB, 下载次数: 0)

2019-12-28 09:32 上传

4 T; I! R# ?- a: B% k

7 l. x: N6 h$ q; t+ B

/ j! T  M* y5 n再送几个案例:$ s0 l8 e. g# a% s

* k+ Z/ n) _# jUse Semiautomatic y-Axis Limits- ~0 s+ ^! Q1 A. p- p

% B7 F/ `) T$ n5 F/ D0 yCreate a suRFace plot and show only y values greater than 0. Specify the minimum y-axis limit as 0 and let MATLAB choose the maximum limit.

3 O: T, m2 U) O! ^/ @% r6 \; [1 k$ e1 S+ F8 W

意思是画一个surface图,仅仅显示y大于0的部分:3 X+ @* `' D2 q* ]

$ H; T3 z% B0 y0 w' O! O% l( E

[X,Y,Z] = peaks;

surf(X,Y,Z)

ylim([0 inf])6 @# v- @3 j; L8 {

2 S$ Y5 F7 d& A; x. d

zlim的简单介绍-4.png (66.9 KB, 下载次数: 0)

2019-12-28 09:33 上传

/ @7 O. g3 d5 u: T; v0 N

0 m  b- }3 C" k) ~

# k. f% S, L1 b5 N& {8 t. A

如果不加限制,也就是全都是auto模式:l  t: x2 E5 f

" b# n# S( M# G: q3 ?8 J

clc

clear

close all

[X,Y,Z] = peaks;

surf(X,Y,Z)3 u9 r! G' c4 U  - h. S' F: I# O1 P" J; L' k

zlim的简单介绍-3.png (116.82 KB, 下载次数: 0)

2019-12-28 09:33 上传

; ~% H3 }9 }4 P0 ~" q9 B9 e

% k( l  p. v! k5 E

* U) Z0 K9 M# i' ^% F只关注y轴就可以看出区别了。# i+ A' [: J: w$ h1 X" o6 ]

8 H- i: N3 L& z' |% n+ |6 s7 gSet Limits for y-Axis with Dates1 ^; m; K+ E6 C) h1 F/ O* f

3 ?- f- `( S5 \. |& G$ ^Create a horizontal bar chart with dates along the y-axis. Set the y-axis limits to range from June 1, 2014 to June 10, 2014.

, _6 ^3 t  b1 q1 A/ f' X$ A6 R- ~# C$ R8 Z. s8 |/ y2 e

意思是创建一个水平条形图,日期位于y轴,设置y轴的限制为从 June 1, 2014 to June 10, 2014.. R# U) ?! W$ z. X1 b

0 V# R" o+ c! z, F& L( \t = datetime(2014,06,1) + caldays(0:20);

y = rand(21,1);

barh(t,y)

tstart = datetime(2014,06,1);

tend = datetime(2014,06,10);

ylim([tstart tend])( N( x, l+ i4 p! { ' `4 M; p- n  y3 K

zlim的简单介绍-2.png (20.31 KB, 下载次数: 0)

2019-12-28 09:33 上传

; k; [2 f$ s6 M! r: F, K* C0 k; G5 B

3 a2 K: G- K" b8 Y# {2 K! j如果不设限制:X% i" b7 F+ L+ @5 o

+ }0 @# |+ i5 Z

clc

clear

close all

t = datetime(2014,06,1) + caldays(0:20);

y = rand(21,1);

barh(t,y), ~$ K7 {( g/ z4 q- f6 z0 c * `) l8 Y6 a4 @  _

zlim的简单介绍-1.png (21.09 KB, 下载次数: 0)

2019-12-28 09:33 上传

' {- a4 g$ M. B9 I8 x. q* z5 r# R

. y+ g) t% m% G

3 ^* }7 S1 _9 H* f: F/ s# F! e% xxlim的用法和ylim几乎一模一样,这里仅仅给出英文版介绍,就不详述了。zlim也一样,就不说了。/ Z3 D8 c, e$ ?9 S

% w  ~# N! }5 \6 zxlim0 u  D$ j  }. B' j4 _4 q

: h7 V6 f* r7 ?6 W- g, b) L( |. h

Set or query x-axis limits5 h/ U) C/ R& F- E5 N% _

2 W8 `1 z1 t$ d4 L5 R; o% q* E! Gcollapse all in page

. u! X( N, A( N  l7 z! @  ?

1 j# x! F& A5 ?4 m3 D3 GSyntax

0 s8 B0 ]( K9 z, Z4 \: y

5 ^' C/ c  y, u/ R8 p; C5 {0 Kxlim(limits)% I$ v2 u- {' V. N! z6 u+ P9 w" c) K

* |/ K( u; ~7 w! [4 ~

xl = xlim

4 ^9 H+ b9 q; z; {  N3 N0 Z! B

% q7 G8 [3 @6 M2 `' o1 sxlim auto

8 o6 F( M# r1 A6 p$ y; R

/ U  y# W6 R2 e7 ~6 Gxlim manual6 Z0 J* C2 H  M) `) J3 a6 h

! U" r+ t* B2 c% n" W: C) W8 B9 lm = xlim('mode')0 v5 J; r2 f( D5 d& X/ Z" n3 B

i; D. r/ l! \* k5 q6 Y" j

___ = xlim(target,___)% B* c" _. w" q

3 n0 p# a$ C9 o# [Description

& `9 B, N3 A$ ~/ J' R5 s6 N% [& b4 y0 p

example

2 H8 q! Z! e6 O' J  s* w; H5 `7 B, t/ R4 r! A

xlim(limits) sets the x-axis limits for the current axes or chart. Specify limits as a two-element vector of the form [xmin xmax], where xmax is greater than xmin.Z8 K$ Z- K% Y: E" E. M* z

# x$ I2 m* D5 X- }) s" I5 @$ lexample

& y; d0 A& u: u6 d8 J2 T

x- x) D. R/ Yxl = xlim returns the current limits as a two-element vector.

7 b2 _1 F( J- H6 Q1 x

! p8 c. ]4 @0 {9 V: Zxlim auto sets an automatic mode, enabling the axes to determine the x-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 the XLimMode property for the axes to 'auto'.

. s' C/ j8 s5 r; m8 b/ H) L2 j% `

8 D* ^/ j' A: o% O- t* @example7 d! E* E7 l% K8 o6 A! h

/ s; l2 O  D2 c% H

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 the XLimMode property for the axes to 'manual'.# H2 R' \8 m+ Q0 d* \' T6 c4 R& w

4 e! Z/ v% r3 n8 D5 C+ xm = xlim('mode') returns the current x-axis limits mode, which is either 'auto' or 'manual'. By default, the mode is automatic unless you specify limits or set the mode to manual.[2 D  O7 u$ n& I+ \

$ K. d6 l0 D% }

example

/ \5 k2 B/ w9 N3 A$ ]) C4 V% E' O+ B

___ = xlim(target,___) uses the axes or chart specified by target instead of the current axes. Specify target 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 the mode inputs, for example, xlim(target,'auto').

4 [+ P" d; q9 n, g2 N, ?( E# Z) v% o% H, k: ?/ w6 M

7 b8 [! A7 U0 S: H, p

* `1 I- [& I0 C6 [6 K5 H. Y$ M4 N3 t6 w! t

xlim用法matlab,MATLAB之xlim 、 ylim 、zlim的简单介绍相关推荐

  1. matlab与python实现神经网络_Adaline神经网络简单介绍和MATLAB简单实现

    Adaline神经网络 Adaline利用了最小二乘法的思想,相较于感知机神经网络,对于数据的线性可分的要求更低一些,可以允许一些异常数据. 上面描述了迭代求解的过程,但是在 x0(k+1) 这里没看 ...

  2. 求介绍matlab函数用法的书,MATLAB初学者教程--函数用法的简单介绍

    1.4 函数用法的简单介绍 1.4.1什么是函数 似乎很多人一听到函数这个词就会想到数学中的某个概念,然后对于恐惧数学的同学就开始打退堂鼓.在matlab当中到处可以用到函数,它的出现可以让我们用很简 ...

  3. length命令怎么用Matlab,matlab中length函数用法

    matlab中的length表示什么?应该如何使用? length:数组长度(即行数或列数中的较大值): 使用方法: n=length(A):如果A为非空数组,返回行数和列数两者之间数值较大的那一个值 ...

  4. 计数器matlab,matlab的stateflow(状态流)简单应用--做一个计数器

    发信人: xxhn (小湖南), 信区: MathTools 标题: matlab的stateflow(状态流)简单应用--做一个计数器 发信站: BBS 水木清华站 (Thu Apr 24 18:0 ...

  5. 第一章 Matlab的简单介绍

    第一章 Matlab的简单介绍 Matlab的发展 Matlab的工作环境 Matlab的帮助系统 Matlab的窗口以及如何设置字体的大小 Matlab写语句 Matlab的执行方式 Matlab的 ...

  6. matlab 样本均值,Matlab | Matlab从入门到放弃(4)——样本均值

    Matlab | Matlab从入门到放弃(4)--样本均值 Matlab | Matlab从入门到放弃(4)--样本均值 博主github:https://github.com/MichaelBee ...

  7. matlab 如何捕捉错误,【matlab|matlab运行错误捕捉方法】

    『傻大方知识库摘要_matlab|matlab运行错误捕捉方法』需安装VC2005运行库.Matlab错误提示往往以DOS窗口显示,错误提示经常一闪而过,无法查看具体错误信息,可以按照如下操作进行查看 ...

  8. 利用matlab来计算双曲函数的值,关于MATLAB第2章数值计算与数据分析的介绍

    关于MATLAB第2章数值计算与数据分析的介绍 MATLAB6.0 数学手册62第 2 章 数值计算与数据分析2.1 基本数学函数2.1.1 三角函数与双曲函数函数 sin.sinh功能 正弦函数与双 ...

  9. 交直流调速系统matlab,MATLAB与交直流调速系统仿真.ppt

    MATLAB与交直流调速系统仿真.ppt MATLAB应用技术,清华大学出版社,王忠礼 段慧达 高玉峰编著,4.MATLAB与交直流调速系统仿真,1 MATLAB基本知识,41控制系统及控制技术指标与 ...

最新文章

  1. 如何安装Oracle客户端(Oracle Instant Client)
  2. 中科大计算机复试题目,中科大计算机复试笔试部分 09-15
  3. python round函数_python中round函数如何使用
  4. 浏览器厂商开始默认支持WebAssembly格式
  5. JS使用XMLHttpRequest对象POST收发JSON格式数据
  6. Let's Encrypt(开源SSL证书管理工具)
  7. 窗体皮肤ssk 跟背景图片冲突_一件靠谱的皮肤衣应该长什么样?
  8. knx智能照明控制系统电路图_智能照明控制系统应用效果
  9. json for java
  10. java代码块是什么_Java代码块
  11. rabbitmq 发送的用户名是什么
  12. 163邮箱服务器连接错误 请重试,163邮箱无法连接服务器
  13. Eclipse 下html语法高亮插件——HTML Editor
  14. LOJ 6198. 谢特(后缀数组+可持久化Trie)
  15. 他,1年9个月获清华博士学位,一作身份发27篇SCI,组队击败NASA打破“航天奥林匹克”欧美垄断...
  16. 【java】getResourceAsStream(“.properties“)配置文件无法读入问题
  17. 微信小程序的项目缓存路径
  18. eemd优缺点_一种改进的EEMD方法及其应用研究
  19. pip:ffi.h: No such file or directory“
  20. 西门子PLC1200学习之硬件接线

热门文章

  1. 计算机组成原理tec9,(15-16-2)实验1-寄存器-TEC9.docx
  2. java deep clone util_Java Clone深拷贝与浅拷贝的两种实现方法
  3. 怎么查MATLAB中的newrbf,已经有了输入输出数据,如何在matlab中建立RBF神经网络
  4. Python中执行外部命令
  5. OC中的字符串常用方法
  6. 分享25个CSS前端网页设计常用技巧
  7. plsql 简单介绍
  8. [转]Using The Entity Framework With WCF
  9. GLUEscript(wxJavascript)
  10. System.Windows.Forms.Timer与System.Timers.Timer的区别