% Set up figure
figure(1) 
h = animatedline;
h.LineStyle = 'none';
h.Marker='.'; 
h.MarkerSize=2;
h.Color='b';
axis([-2.5 2.5 -2.5 2.5]);

% Parameters
N=500;   % Number of iterations
a=1.5;
b=.3;

% Get [sx0,y0] for first orbit
[x0 y0 bb]=ginput(1);

% Plot orbits
while bb<2,
    addpoints(h,x0,y0);
    % Iterate under map
    for i=1:N,
        x1=a-x0^2+b*y0;
        y1=x0;
        % Reset x0, y0
        x0=x1;
        y0=y1;
        addpoints(h,x0,y0);   
    end
    % Get next orbit (leftclick) or quit (rightclick)
    [x0 y0,bb]=ginput(1);
end