%%% plot the Nelson potential (no moral suasion here)

step = .01;
x = -3 : step : 3;
y = -2 : step : 4;

xx = ones(size(y))'*x;
yy = y'*ones(size(x));

V = 0.1 * xx.^2/2 + (yy - xx.^2/2).^2;

[yi,xi] = find(V<=1.2);
xlim = [x(min(xi))-step x(max(xi))+step]
ylim = [y(min(yi))-step y(max(yi))+step]

figure(1);

[cs,h] = contour(x,y, V, 0:.1:1);
%[cs,h] = contour(x,y, V, [.65 .65]);

%set(gca, 'XLim', [min(x), max(x)]);
%set(gca, 'YLim', [min(y), max(y)]);
set(gca, 'XLim', [xlim(1)-.02, xlim(2)+.02]);
set(gca, 'YLim', [ylim(1)-.02, ylim(2)+.02]);

% the next line is for matlab 5.x only!
set(gca, 'DataAspectRatio', [1 1 1])
%set(gca, 'AspectRatio', [1 1])

clabel(cs,h,'manual');
