|
|
可以同时修改颜色和粗细,使各组线有一个变化的效果。
* @9 B4 T+ f3 R4 u0 p4 F/ G! x
clear all/ K% I* a% u4 x" {! o
clc F% L2 o J; y
clf
3 S* J1 Z0 k7 ~0 B7 g% ]
& l1 s- f/ c0 @6 {x=1:0.2: (2*pi);, I* S! |$ {9 P! v
hold on! G/ ~( a+ _7 o0 N9 F( ^
for i=1:9
, T6 q! B: \% |4 P I y=sin(x+i*pi/10)+exp(x/5);
/ N+ r2 _8 z T3 L) K7 ~ plot(x,y,'.-','Color',[(0.7+0.1/i)^2 1-(0.1*i) 0.5/i^2],'LineWidth',2+0.5*i);. }* d. C$ b+ l1 y1 ?% t4 {/ A
str{i}=['H=',mat2str(i*0.01)];
! `" P+ N& ]# ?. A) n6 W8 E) uend
& `; C# L' }! L3 b2 `7 jlegend(str)
& K2 \( }! K) s% d+ Ghold off
# s3 j W- H: m' u: a4 M
! i' F; p, f. |7 A& a) f/ R; d
q6 R3 i6 l6 q* @5 }% O) L A4 _
|
|