-- % dashed 4、二维图画图 plot(X,Y) %X,Y分别为两个数组,X为自变量,Y为因变量plot(X1,Y1,...Xn,Yn) %多个数据数据画在同一张图上 plot(X,Y,'g--o') %调整颜色线条,此处是绿色,dashed line以及circle的点 5、标题指令 title('XXXXX') %标题名 6、坐标轴 xlabel('XXXX') ylabel('XXXX') ...
% 定义x轴数据 x = 0:0.1:10; % 定义y轴数据 y = sin(x); % 绘制虚线 figure; plot(x, y, 'LineStyle', '--', 'Color', 'r', 'LineWidth', 2); % 设置图形标题和轴标签 title('Sine Wave with Dashed Line'); xlabel('x'); ylabel('sin(x)'); 在这个例子中,plot函数被用来绘制x...
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 withPLOT(X,Y,S) where S is a character string made from one elementfrom any or all the following 3 column...
"-" Solid line "--" Dashed line ":" Dotted line "-." Dash-dotted line MarkerDescriptionResulting Marker "o" Circle "+" Plus sign "*" Asterisk "." Point "x" Cross "_" Horizontal line "|" Vertical line "square" Square "diamond" Diamond "^" Upward-pointing trian...
plot(cos(0:pi/20:2*pi), 'or--'); % circle red point, dashed line plot(sin(0:pi/20:2*pi), 'xg:'); % cross green point, dotted line hold off 搜索栏搜索linespec,可以看到更多的plot style。 legend() 增加每条线的标题 legend('L1', ...) ...
Specify a dashed line style for the second line and a dotted line style for the third line. Get x = 0:pi/100:2*pi; y1 = sin(x); y2 = sin(x-0.25); y3 = sin(x-0.5); figure plot(x,y1,x,y2,'--',x,y3,':') MATLAB® cycles the line color through the default color...
-- dashed(虚线) m magenta(紫红色) * star(星号) (none) no line y yellow(黄色) s square(正方形) k black(黑色) d diamond(菱形) v triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h hexagram Example x = -pi:pi/10:pi; y = tan(sin(x)) - sin...
'--' Dashed line ':' Dotted line '-.' Dash-dotted line 'none' No line No line LineWidth— Edge line width 0.5 (default) | positive value | vector Edge line width, specified as the comma-separated pair consisting of 'LineWidth' and a positive value in point units or a vector of...
matlab画图实际上就是描点连线,因此如果点取得不密,画出来就成了折线图,请试验之 2 Y=sin(10x); plot(x,y,‘r:’,x,Y,‘b’) % 同时画两个函数 3 若要改变颜色,在座标对后面加上相关字串即可: x=0:0.01:10; plot(x,sin(x),‘r’) 4 若要同时改变颜色及图线型态(Line style),也是在坐标对...
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 ...