Why does MatLab subbornly enforces an accessible A4 format width of 17.197916666666664 cm (not 21 cm)???
조회 수: 2 (최근 30일)
이전 댓글 표시
hello,
here is what appears to be a stupid assumption of MatLab, about what are the capabilities of your printer with respect to its minimum margin capabilities :
try this one:
F= figure;
h = gcf ; % current figure handle
h.Units = 'centimeters';
h.PaperType= 'A4';
h.PaperUnits = 'centimeters';
h.PaperOrientation= 'landscape'; % 'portrait';
h.PaperPositionMode= 'manual'; % 'auto';
h.Position = [0 0 29.7 21.0 ];
h.PaperSize = [29.7 21.0];
now, type on the command line:
>> h.position
ans = 0 0 29.7000 17.1979
From the property inspector the last number is actually 17.197916666666664 cm
or differently just type:
sprintf('Obtained Width = %20.18f cm ...',h.Position(4))
So it looks that Matlab enforces what it believes is an "Grand Universal Value for Accessible Margins for all Existing Printers in the World"...;
>>> 17.197916666666664 cm: How clever from MatLab indeed !
>>> Or it is a bug that the MatLab team is unable to correct ?
A new acronym should be defined for MatLab: WatYouGetIsNotWhatYouWant
:-(
댓글 수: 0
답변 (2개)
Steven Lord
2022년 3월 27일
What is the value of the figure's PaperPosition property? The purpose of that property is to specify the "Figure size and location on page when printing or saving, specified as a four-element vector of the form [left bottom width height]." as opposed to the Position property which controls "Location and size of the drawable area, specified as a vector of the form [left bottom width height]. This area excludes the figure borders, title bar, menu bar, and tool bars."
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!