plot函数可以接一些参数,来改变所画图像的属性(颜色,图像元素等)。线形颜色
颜色:
b blue(蓝色)
g green(绿色)
r red(红色)
c cyan(墨绿色)
m magenta(紫红色)
y yellow(黄色)
k black(黑色)
线形:
. point(点)
- solid(实线)
o circle(圆圈)
: dotted(点线)
x x-mark(叉号)
-. dashdot (点画线)
+ plus(加号)
– dashed(虚线)
* star(星号)
(none) no lines %没弄清楚!!!!!
s square(正方形)
d diamond(菱形)
v triangle (down)
^ triangle (up)
< triangle (left)
> triangle (right)
p pentagram
h hexagram
弄个例子,大伙看看效果:
a=1:21;
x=sin(1:0.3:7);
y=cos(1:0.3:7);subplot(2,2,1);
plot(a,x,’<r’,a,y,’g*’);
title(‘plot线形演示’)
subplot(2,2,2);
plot(a,x,’-.r’,a,y,’gp’);
title(‘plot线形演示’)
subplot(2,2,3);
plot(a,x,’: y’,a,y,’gd’);
title(‘plot线形演示’)
subplot(2,2,4);
plot(a,x,’sm’,a,y,’ch’);
title(‘plot线形演示’)
0 Comments.