Multiples figures of 4x2 subplots....

6 views (last 30 days)
Jules Ray
Jules Ray on 19 Sep 2014
Edited: Jules Ray on 19 Sep 2014
Hello dudes: I'm preparing a code to create mutiples figures, each one consisting of subplots. because this will be part of a GUI i created the script with loops. This is the script:
a)the total number of figures is variable and defined as (nim) b) each figure is opened and their axis copied and pasted inside each of the subplots c) beacuse each figure is diferent i preceed to define the xlim and y lim for each subplot d) i defined a standar size for the subplots, is 4x2
%%%%%%%%%%%%%%%%DONT close any figure %%%%%%%%%%%%%%%%%%%%%
%%copying and pasting active objects & creating of multiple pages
ps=8;% plots per page
np=nim; %number of plots
for it=1:np
xt=rem(it-1,ps)+1;
if xt==1
figure;
end
ax1=subplot(4,2,xt);
%title(sprintf('plot #%-1d',it));
xlim(Xll(it,:)); %xlimits, come from figure structure
ylim(Yll(it,:)); %ylimits, come from figure structure
copyobj(allchild(get(h1(it),'CurrentAxes')),ax1);
%check this
fout = sprintf('%s_DR.pdf',station);
saveas(gcf,fout,'pdf');
end
however, the script is not working it all, instead of produce new figures produces identical figures in pdf.
What is missing to do what i want???? thanx in advance
  3 Comments
Jules Ray
Jules Ray on 19 Sep 2014
here the .mat file.... i would like aslo save each figure as a pdf, but i dont know how...

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!