command for one copy of 3 figure in subplot form and put it in only one picture in bmp format
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Grzegorz Knor
el 6 de Sept. de 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 comentarios
Grzegorz Knor
el 6 de Sept. de 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
el 6 de Sept. de 2011
Categorías
Más información sobre Subplots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!