필터 지우기
필터 지우기

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