How to set the proper papersize?

203 次查看(过去 30 天)
Mr M.
Mr M. 2015-11-9
评论: Mr M. 2015-11-9
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?

回答(1 个)

Walter Roberson
Walter Roberson 2015-11-9
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 个评论
Mr M.
Mr M. 2015-11-9
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by