MATLAB: How to copy a plot

copy plot plotyy new figure

How can I copy a plot into a new figure. Then on the new figure plot a vector on a second y axis. I have tried to use the copyobj and plotyy. However I may been using incorrect syntax.
Update
The original figure is produced by a function. What would be the syntax in this case?

Best Answer

fH(1) = figure(1);
fH(2) = figure(2);
fH(3) = figure(3);
figure(fH(1));
lH = plot(rand(10,2));
aH = ancestor(lH(1),'axes');
figure(fH(2));
aH(2) = axes;
copyobj(lH(1),aH(2)); %copy line to axes
copyobj(aH(1),fH(3)); %copy axes to figure