control checkerboard pattern size on printed paper

6 次查看(过去 30 天)
Hi
I would like to print the following checkerboard to a pdf file such that it has the correct given dimension on the A4 sheet. The example is a 6 times 6 tile pattern where each tile is 20 pixels times 20 pixels. I would like that the pattern is exactly 12 cm times 12 cm when printed on a4 paper. I have tried fig.PaperPosition and ax.Position but, as you can see from my example I did not succeed.
Im = checkerboard(20,3,3);
h = figure;
imshow(Im)
hold on
plot([10,100,100,10,10],[10,10,100,100,10],'r*-')
fig = gcf;
fig.PaperType = 'a4';
fig.PaperUnits = 'centimeters';
fig.PaperOrientation ='landscape';
fig.PaperPosition = [1 1 12 12];
print('-dpdf','tester.pdf','-r1080')
Any help is much appreciated :)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by