| Jiro Doke 2005-04-23, 3:59 pm |
| Vincent Y. wrote:
>
>
> Thank you Jiro, it really works!
>
> But one more question!
>
> I don't want the black horizontal line (the x axis).
> I set axis off but the line still there.
>
> Any suggestion??
>
> Vincent
Vincent,
That's because you have 2 patches that includes a boundary on the
x-axis. You can set the edge color to red:
set(h,'edgecolor','r');
OR get rid of the x-axis boundary and use one big patch with the top
and bottom sinusoidal boundaries:
----------------------
close all, clear all;
w1=2*pi;
b1=0.2;
t=0;
x=-8*pi:16*pi/8000:8*pi;
f1=cos(w1*t)*cos(w1*t-b1*x)+2.0;
f2=cos(w1*t)*cos(w1*t-b1*x+pi)-2.0;
xx=[x x(end:-1:1)];
ff=[f1 f2(end:-1:1)];
fig=figure;
set(fig,'DoubleBuffer','on');
h=fill(xx,ff,'r');
%axis([0 14 -4.5 4.5])
while 1
drawnow
t=t+2*pi/200;
f1=cos(w1*t)*cos(w1*t-b1*x)+2.0;
f2=cos(w1*t)*cos(w1*t-b1*x+pi)-2.0;
ff=[f1 f2(end:-1:1)];
set(h,'YData',ff);
end
----------------------
jiro
|