command for one copy of 3 figure in subplot form and put it in only one picture in bmp format
Afficher commentaires plus anciens
anyone know how can copy a figure in subplot form and put(for example in .bmp format) it in a specified folder. there are 3 figures in subplot form
Réponse acceptée
Plus de réponses (1)
Grzegorz Knor
le 6 Sep 2011
Is this what you meant?
% example figure
subplot(311)
plot(rand(100,1),'r')
subplot(312)
bar(rand(5,1))
subplot(313)
semilogy(1:10)
% save
print(gcf,'-dbmp','C:\Documents and Settings\user\My Documents\MATLAB\picture.bmp')
2 commentaires
Grzegorz Knor
le 6 Sep 2011
Alternatively:
% example figure
s(1) = subplot(311);
plot(rand(100,1),'r')
s(2) = subplot(312);
bar(rand(5,1))
s(3) = subplot(313);
semilogy(1:10)
% save
h = figure;
for k=1:3
copyobj(s(k),h)
print(h,'-dbmp',['C:\Documents and Settings\grzesiek\My Documents\MATLAB\picture' num2str(k)])
clf
end
close(h)
or
% save
h = figure;
for k=1:3
copyobj(s(k),h)
set(gca,'Units','normal','Position',[.1 .1 .8 .8])
print(h,'-dbmp',['C:\Documents and Settings\grzesiek\My Documents\MATLAB\picture' num2str(k)])
clf
end
close(h)
mohammad
le 6 Sep 2011
Catégories
En savoir plus sur Subplots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!