function [] = return_probability_plot(time)

% retplot TIME -- plot return probabilities for time TIME

eval ([ 'load retn.' time ]);
num = eval(time);
ttl = sprintf('T = %.2f', num);

% construct the angles.
sz = size(retn);
angles = sz(2)-2;
theta = (0:2*angles-1)*pi/angles;
sinth = sin(theta);
costh = cos(theta);

maxdata = max(max(retn(:,3:sz(2)).^2))
scale = .5 / maxdata;

for i = 1:sz(1),
	data = scale * retn(i,3:sz(2)).^2;

	xx = retn(i,1) + [data data].*costh;
	yy = retn(i,2) + [data data].*sinth;

	plot([xx xx(1)],[yy yy(1)]);
	plot([-xx -xx(1)],[yy yy(1)]);
	hold on
end

axis equal;
if 1
	if 0
		% draw a r=1 circle for comparison
		plot(-1.45+scale*([costh costh(1) 0]+1), ...
			-.95+scale*([sinth sinth(1) 0]+1))
	end

	title(ttl);

	set(gca,'XLim',[-1.5 1.5],'YLim',[-1 1]);
end

hold off
set(gca,'LineWidth',.99*get(gca,'LineWidth'));

%orient landscape;print /tmp/retplot

ttl
