I am facing a strong problem regarding exact figure width. A priori, I am familiar with the usual commands, here is my code :
ss = get(0,'screensize');
widthScreen = ss(3);
heightScreen = ss(4);
widthFig = 10.0;
heightFig = 5;
posFig = [0.5*(widthScreen-widthFig) 0.5*(heightScreen-heightFig)...
'PaperSize', [widthFig heightFig],...
'PaperPosition',[0 0 widthFig heightFig]);
When I run my code and measure the figure width on the screen, it is always something like ~9.1cm. Using the following lines
pos = get(gcf, 'Position');
width = pos(3)
Ouput is 10.020088854166666
All of this is really strange. What am I doing wrong? Up to now, I have used this very useful codes to export figures already sized in cm, but I actually figured out that the size is not correct.
Thanks forward for your help.