MATLAB Answers

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

1 view (last 30 days)
Michael Steinbuechler
Michael Steinbuechler on 18 Jun 2018
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 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.

Products


Release

R2018a