From: noveen on
I have generated a few graphs using m files. For the purpose of study and comparison is it possible to merge the data of various figures / plots and generate one single plot
From: Andy on
"noveen " <noveenkapur(a)yahoo.co.in> wrote in message <i3729c$b2h$1(a)fred.mathworks.com>...
> I have generated a few graphs using m files. For the purpose of study and comparison is it possible to merge the data of various figures / plots and generate one single plot

doc hold
From: Walter Roberson on
noveen wrote:
> I have generated a few graphs using m files. For the purpose of study
> and comparison is it possible to merge the data of various figures /
> plots and generate one single plot

If you have existing figures, you can use copyobj() to copy the parts
into a new figure. I would speculate, though, that you would like to
subplot() and copyobj() the axes contents to the new axes; if you do
that, watch out because legend() is implemented using a second axes and
plotyy() is two axes in the same place.

Possibly you might want to start by dividing the new figure up in to
uipanel() and then copyobj() the individual figures's contents into the
panels: that way they should not overlap.
From: us on
"noveen " <noveenkapur(a)yahoo.co.in> wrote in message <i3729c$b2h$1(a)fred.mathworks.com>...
> I have generated a few graphs using m files. For the purpose of study and comparison is it possible to merge the data of various figures / plots and generate one single plot

one of the solutions
- note: it's not as trivial as MLbbers might hope...

% create two figures
x=1:10;
figure;
line(x,rand(size(x)),'marker','s','color',[1,0,0]);
line(x,1+rand(size(x)),'marker','o','color',[0,1,0]);
ah1=copyobj(gca,gcf);
figure;
line(x,3+rand(size(x)),'marker','s','color',[0,0,1]);
ah2=copyobj(gca,gcf);
% combine content of each figure into a third figure
figure('name','COMBINED');
axes;
set(gca,'xlim',[-10,20],'ylim',[-1,5]);
copyobj(get(ah1,'children'),gca);
copyobj(get(ah2,'children'),gca);

us