Haitham - Consider using copyobj which will allow you to copy a graphics object from one parent to another. Suppose you have the following figure which displays a single axes with the sine curve drawn on it figure;
x = linspace(-2*pi,2*pi,500);
y = sin(x);
hCurve = plot(x,y,'r');
So we create a figure and draw the sine curve to it. The output from plot is a handle to the graphics object, and is saved to hCurve.
In a second figure we create the figure and two sup lots
figure;
hSub1 = subplot(2,1,1);
hSub2 = subplot(2,1,2);
hSub1 and hSub2 are handles to the axes of each subplot. We then copy the curve to the first axes as
And we see that the sine curve has been copied over.
You can do something similar starting with your fig_i handle. Since it is a handle to a figure, then you want to first get the handle to the axes on that figure (let's assume that you just have the one axes). You can do this as
hFigIAxes = findobj('Parent',fig_i,'Type','axes');
So the above searches for any graphics object whose parent is the handle fig_i and whose type is axes. We then can copy the axes children (which are the graphics objects drawn on it) to the subplot
if ~isempty(hFigIAxes)
hAxes = hFigIAxes(1);
copyobj(get(hAxes,'Children'),hSub1);
end
Try the above and see what happens!
Best Answer