Example
clc,clear
x = linspace(0,10);
y = sin(x) + 0.1*cos(10*x);
fid = figure;
h1 = gca;
plot(x,y);
hold on
h2 = axes('Parent',fid,'Position',[0.6 0.2 0.2 0.2]);
plot(x,y)
hold on
for i = 1:length(x)
h(1) = plot(h1,x(i),y(i),'or');
h(2) = plot(h2,x(i),y(i),'or');
xlim(h2, [-1 1]+x(i))
ylim(h2, [-1 1]+y(i))
pause(0.2)
delete(h)
end
hold off
But when i try to plot in the same figure
fid = figure(1)

Any idea?
