Saved figure different than actual figure size (?)
Mostrar comentarios más antiguos
Hi, I'm trying to save a figure as a .tif, however, the output .tif file is different than the specified figure size. Here is an example:
im=imread('rice.png');
fig=figure;
set(gcf,'Position',[30 30 512 256]);
hL=axes('Position',[0 0 .5 1],'Visible','off');
hR=axes('Position',[.5 0 .5 1],'Visible','off');
set(gcf,'CurrentAxes',hL);
imshow(im,[]);
set(gcf,'CurrentAxes',hR);
imshow(im,[]);
print(gcf,'-dtiff','temp');
The output image is 1200 x 900 pixels, not the 512 x 256 I specified in the program. What am I missing during the export to get the output to be 512 x 256?
Thanks, Matt K.
Respuesta aceptada
Más respuestas (3)
Walter Roberson
el 25 de Feb. de 2011
1 voto
See the figure PaperPosition and PaperPositionMode properties.
the cyclist
el 25 de Feb. de 2011
Can you use the -r option? E.g.
>> print(gcf,'-dtiff','-r300','temp')
Oliver Woodford
el 27 de Feb. de 2011
To get the output you expect (i.e. a fair representation of the figure on the screen) without having to set lots of options, use export_fig.
In this case try:
export_fig temp.tif -nocrop
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!