How to keep the figure scale with different screen resolutions when using print to PDF?

1 view (last 30 days)
Hello Matlab Pros,
I use this code to create a figure with a rectangle and print it to pdf:
f1 = figure(...
'Units', 'centimeters',...
'Position', [1 1 21 29.7],...
'menubar', 'none',...
'name', 'Report',...
'numbertitle', 'off',...
'Color', 'w',...
'resize', 'off',...
'Visible', Visability,...
'PaperType', 'a4',...
'PaperOrientation', 'portrait');
axes('Position', [0 0 1 1],...
'Visible', 'off',...
'XLim', [0 21],...
'YLim', [0 29.7]);
rectangle('Position',[2.85 2.7 16.45 24.7])
print('Test','-dpdf')
The problem is, that if the resolution of my screen changes, the PDF changes drastically. Is it possible to prevent this? On the attached pictures you can see exactly what I mean (The first one is with a resolution of 1920x1080 and the second one with 800x600).
Thanks in advance!
Best Regards Michael
EDIT: It should be mentioned that the layout of the first picture is the one I actually want to have, regardless of the screen resolution.

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!