Azzera filtri
Azzera filtri

Why does MatLab subbornly enforces an accessible A4 format width of 17.197916666666664 cm (not 21 cm)???

2 visualizzazioni (ultimi 30 giorni)
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
:-(

Risposte (2)

Steven Lord
Steven Lord il 27 Mar 2022
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."

francois heslot
francois heslot il 29 Mar 2022
Hello Steven,
Along your suggestion,
I did set
h.PaperPosition = [0 0 29.7 21]
now I get a closer value, but still missing the exact mark.
h.Position
ans =
0 0 29.6968 20.9550
  • Any idea of why this is not 29.7000 X 21.0000 cm ? arn't we talking of parameters whose values are stored as 'double' ?
  • If I WANT to get the whole 21 X29.7 cm paper as drawable area, and get 20.00 cm in MatLab correspond to 20.00 cm on paper, what is the way to go ? ( I do *not* want an automatic inclusion of "figure borders, title bar, menu bar, and tool bars"s)
thanks,

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by