Actions

Sayres logistic plot M-code

From Santa Fe Institute Events Wiki

function h = plotLogistic(R, N, X0);
% Plot Xn against Xn+1 for a discrete logistic population.
%
% h = plotLogistic(R, N, X0);
%
% ras, 06/02/08.
if nargin < 1, error('Need conrol param R');	end
if notDefined('N'),		N = 10;					end
if notDefined('X0'),	X0 = 0.5;				end 
%% compute the logistic
X = logistic(R, N, X0); 
%% plot
h = figure('Color', 'w');
 cla; hold on
for n = 2:N
	plot(X(n-1), X(n), 'k.');
end
axis equal
xlabel('X_n');
ylabel('X_{n+1}');
title( sprintf('R = %2.2f', R) );
return