control checkerboard pattern size on printed paper

5 views (last 30 days)
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 :)

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!