Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Opening .fig files as a subplot

285 views
Skip to first unread message

Nadir

unread,
Dec 25, 2005, 11:56:00 AM12/25/05
to
Hi,

I have a bunch of .fig files, I want to indicate them in a subplot
sequence.

As far as I've realized, (even) Matlab 7 isn't able to open a .fig
file automatically when creating a subplot. Or am I missing
something?

Is there any way of opening fig files as subplots?

per isakson

unread,
Dec 25, 2005, 1:52:21 PM12/25/05
to

No. However, replace the "subplots" by iupanels and use hgload.
Something like

ohf=figure
ohp= uipanel( ohf,'units','normal','pos',[0,0,1/2,1/2] )
ohs=hgload( 'untitled.fig');
set( get(ohs,'child'), 'parent', ohp )
close(ohs)

/ per

us

unread,
Dec 25, 2005, 2:08:11 PM12/25/05
to
Nadir:
<SNIP wants to copy figs into subplots...

one of the solutions

% create a fig
fnam='foo.fig';
fh=figure;
surfl(peaks(32));
shading interp;
camlight right;
lighting phong;
title('TEST');
saveas(gcf,fnam);
delete(fh);
% the engine
% ...a subplot template
fhs=figure;
for i=1:2
sh(i)=subplot(2,2,i);
end
% ...reload the figs (here we use the same fig!)
for i=1:2
fh=open(fnam);
ah=gca;
% ...move it to the subplot
ch=copyobj(ah,fhs);
% ...resize it
set(ch,'position',get(sh(i),'position'));
% ...and delete the fig's canvas
delete(fh);
end
% ...delete the template
delete(sh);

us

0 new messages