How to print figure precisely to A4 without scale
72 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
Firstly thanks to anyone who can help me with this problem.
I have a program for academic work that produces some figures. On these figures are measurements that I would like to be precisely the same as on the paper that I print it from. However after several attempts from online research (paper type, orientation, size) I cannot get the axis measurement to be true to when I measure it on paper (with a ruler) therefore affecting the size of my figure.
Is there a specific way to export to a printable file (as this PC does not have direct printing links) that I can print to typical A4 and the measurements will match up.
In terms of coding all I have is, the rest I tried to change in the sub-menus:
figure,plot(w,-al,-w,-al)
Thanks in advance.
0 Kommentare
Antworten (2)
per isakson
am 16 Jan. 2013
I have an old m-function, A4Paper, which I use now and then. It produces a figure, the size of A4-paper, on screen. It allows me to position axes using centimeters and when printed on paper size and location on the printed paper agrees "exactly" with those given. E.g.
ohf = A4Paper( 'create', 'sa4' );
U = get( gcf, 'UserData' );
axes( 'pos', U.p2d.*[ 3, 3, 8, 8 ] )
and File menu, Print gives me a printout on which I can use a ruler. Both axes are 80 mm long as far as I can measured with my old plastic ruler.
However, I fail to print to a file. I tried to print to the Adobe PDF printer, and a couple of variants with the function, print. On paper they end up some 5% to small. The margins are increased and the printing area is decreased.
This makes me tired.
I've mailed A4Paper to you via [Contact Craig]. You might want to delete it together with other spam.
Michael Wagner
am 13 Sep. 2023
G'day Craig,
After a weekend of trials and errors, I found the following code to work for my problem of printing a 10cm square to paper with precise dimensions:
f=figure(1);
f.Units='centimeters';
f.Position(3:4)=[10,10];
f.PaperType="A4";
f.PaperUnits="centimeters";
fig.PaperPosition(3:4)=[10,10];
get(f) %get list of all figure properties
R = [0,10,10, 0,0 %Plot rectangle of size 10cm x 10cm
0, 0,10,10,0];
plot(R(1,:),R(2,:))
a=gca;
a.Units='centimeters';
a.XLim=[0,10];
a.YLim=[0,10];
a.InnerPosition(3:4)=[10,10];
a.PlotBoxAspectRatio=[1 1 1];
get(a) %get list of all axes properties
1 Kommentar
Michael Wagner
am 13 Sep. 2023
Delete Line 6, starting with fig.PaperPosition, and make Lines 4 & 5 prettier with single quotes.
Siehe auch
Kategorien
Mehr zu Polar Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!