How to set the proper papersize?

202 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 9 de Nov. de 2015
Comentada: Mr M. el 9 de Nov. de 2015
I would like to use: figure('units','normalized','outerposition',[0 0 1 1]); to see my figures in the largest size on my screen. But after that I want to save it in a pdf format, but with a proper paper size, which is do not needlesly too big. For example on my screen: set(gcf,'PaperPositionMode','auto','papersize',[24 16]); is enough but too big. My question is how to calculate or get the proper number instead of [24 16] on an arbitrary screen automatically?

Respuestas (1)

Walter Roberson
Walter Roberson el 9 de Nov. de 2015
You should set the figure PaperUnits property to indicate the scale you wish to use.
It is not possible to set a single paper size that will automatically adjust to all screens that are used to read the PDF.
If you want to set it to match the size of the figure that is being used, then set the figure Units property to be the same as the PaperUnits that you will be using, then get() the figure Position property; the last two components of that will be the width and height.
oldunits = gcf('Units');
set(gcf, 'PaperUnits', 'cm', 'Units', 'cm');
figpos = get(gcf, 'Position');
set(gcf, 'PaperSize', figpos(3:4), 'Units', oldunits);
  1 comentario
Mr M.
Mr M. el 9 de Nov. de 2015
I want to use fullscreen figure window, but I dont want to restrict the ratio. Therefore it is possible to have a blank margin. After that I want to save the cropped figure into the pdf, and see the same textsize (in the pdf document) and everything else as shown on the screen.

Iniciar sesión para comentar.

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by