stackedplot 函数_【matlab 基础篇 03】一文带你全面了解 plot 绘图函数的使用(超详细+图文并茂)...

这篇博客详细介绍了MATLAB中plot函数的使用,包括颜色、形状、线型的修改,多条曲线的绘制,以及subplot、title、xlabel、ylabel和legend等的使用方法,通过实例演示帮助初学者掌握plot函数。
摘要由CSDN通过智能技术生成

快速入门matlab,系统地整理一遍,如何你和我一样是一个新手,那么此文很适合你;

1 前言

如果你是和我一样的小白,强烈推荐看看这里,需要合理地利用官方的文档,通常我觉得官方文档是最好的,没有之一,在命令终端输入help plot,可以看到详细的帮助文档;具体如下;

>> help plot

plot Linear plot.

plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix,

then the vector is plotted versus the rows or columns of the matrix,

whichever line up. If X is a scalar and Y is a vector, disconnected

line objects are created and plotted as discrete points vertically at

X.

plot(Y) plots the columns of Y versus their index.

If Y is complex, plot(Y) is equivalent to plot(real(Y),imag(Y)).

In all other uses of plot, the imaginary part is ignored.

Various line types, plot symbols and colors may be obtained with

plot(X,Y,S) where S is a character string made from one element

from any or all the following 3 columns:

b blue . point - solid

g green o circle : dotted

r red x x-mark -. dashdot

c cyan + plus -- dashed

m magenta * star (none) no line

y yellow s square

k black d diamond

w white v triangle (down)

^ triangle (up)

< triangle (left)

> triangle (right)

p pentagram

h hexagram

For example, plot(X,Y,'c+:') plots a cyan dotted line with a plus

at each data point; plot(X,Y,'bd') plots blue diamond at each data

point but does not draw any line.

plot(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by

the (X,Y,S) triples, where the X's and Y's are vectors or matrices

and the S's are strings.

For example, plot(X,Y,'y-',X,Y,'go') plots the data twice, with a

solid yellow line interpolatin

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值