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

2 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by