How to print figure precisely to A4 without scale
조회 수: 70 (최근 30일)
이전 댓글 표시
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
답변 (2개)
per isakson
2013년 1월 16일
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
2023년 9월 13일
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
Michael Wagner
2023년 9월 13일
Delete Line 6, starting with fig.PaperPosition, and make Lines 4 & 5 prettier with single quotes.
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!