plot(x, y1, x, y2, '--', x, y3, ':') plot(x, y1, x, y2, '--r', x, y3, ':r') line(x,y,'Color','red','LineStyle','--') 默认线宽0.5(磅),推荐设置1、1.5或2,视情况而定。创建基本线条 - MATLAB line - MathWorks 中国 数据点标记 指定绘图中的线和标记
1 第一,启动MATLAB,新建脚本(Ctrl+N),输入如下代码:close all;clear all;clcx=0:pi/50:2*pi;y=sin(x);hline1=plot(x,y,'k','linewidth',3);hline2=line(x+0.05,y,'linewidth',4,'color',[.8,.8,.8]);set(gca,'children',[...
plot(x,y,"LineWidth",2,"LineStyle","--","Color",[0.1,0.2,0.3]) % 横坐标为x,纵坐标为y,线宽为2,线型为--,指定颜色的折线图 plot(x,y1,x,y2,'--',x,y3,':') % 分组绘制多折线图,并分别指定线型 plot(x,y,'-o','MarkerIndices',1:5:length(y)) % 设置线型,并设置显示的标记数量...
plot(x1,y1,lineSpec1,x2,y2,lineSpec2,...) lineSpec包含设置线条样式(line-style),标记符号(marker)和颜色(color) , 表示对plot绘制图形的样式、标记符合和颜色进行调整 。 三个属性没有顺序,如果缺少一个,则表示没有 matlab文档中提供了所有的样式颜色符号表,help plot 可以查看参考页的input Arguments(输入...
plot([1 2 3 4 5 6],[0 3 1 6 4 10],'o') You can use the linespec argument to specify a named color, but to specify a custom color, set an object property. For example, Line objects have a Color property. Create a plot with a purple line that has circular markers. Specif...
x = linspace(0,10); y = sin(x); plot(x,y,'-o','MarkerIndices',1:5:length(y)) Specify Line Width, Marker Size, and Marker Color Copy Code Copy Command Create a line plot and use the LineSpec option to specify a dashed green line with square markers. Use Name,Value pairs to ...
line.The X,Y pairs, or X,Y,S triples, can be followed byparameter/value pairs to specify additional propertiesof the lines. For example, PLOT(X,Y,'LineWidth',2,'Color',[.6 0 0])will create a plot with a dark red line width of 2 points.Backwards compatibilityPLOT('v6'...
To plot multiple sets of coordinates on the same set of axes, specify at least one of X or Y as a matrix. example plot(X,Y,LineSpec) creates the plot using the specified line style, marker, and color. plot(X1,Y1,...,Xn,Yn) plots multiple pairs of x- and y-coordinates on the ...
x = linspace(0,10); y = sin(x); plot(x,y,'-o','MarkerIndices',1:5:length(y)) Specify Line Width, Marker Size, and Marker Color Copy Code Copy Command Create a line plot and use the LineSpec option to specify a dashed green line with square markers. Use Name,Value pairs to ...
opts.Title.FontSize = 15; opts.Title.Color = [1 0 0]; opts.Title.String = 'System Frequency Response'; opts.FreqUnits = 'Hz'; Now, create a Bode plot using the options set opts. Get bodeplot(tf(1,[1,1]),opts); Because opts begins with a fixed set of options, the plot re...