clear all
%
% Plot iterate graph of map x_(n+1)=f(x_n) 
% Logistic map f=4*lambda*x*(1-x) is used
%

lambda=.95;
x=0:.01:1;
f=4*lambda*x.*(1-x); % first iterate of f
f2=4*lambda*f.*(1-f); % second iterate of f
%f3=4*lambda*f2.*(1-f2); % 3rd iterate of f, and so on.

figure(1)
hold off

plot(x,f)
hold on
plot(x,f2,'r-','linewidth',2)

%plot(x,f3,'m-','linewidth',2)


plot([0 1], [0 1], 'k--') % Add the diagonal line.

xlabel('x','fontsize',16)
ylabel('y','fontsize',16)

axis([0 1 0 1])