I need to build two curves, as shown below, that overlap each other. How can I make the overlapping area transparent so that the bottom curve is visible? In the overlap area, I can only see the upper curve.
x=0:0.01:2*pi; %
y1=sin(x); %
y2=sin(x)+.5; %
X=[x,fliplr(x)]; %
Y=[y1,fliplr(y2)]; %
fill(X,Y,'b'); %
%*****************
hold on
x=0:0.01:2*pi; %
y1=sin(2.*x); %
y2=sin(2.*x)+.5; %
X=[x,fliplr(x)]; %
Y=[y1,fliplr(y2)]; %
fill(X,Y,'b'); %
source
share