How to adjust matlab figure size to powerpoint

28 次查看(过去 30 天)
Currently I am outputting figures from matlab to the current directory using the following short script:
plot(1:10) % Example graph
set(gcf,'PaperUnits','centimeters','PaperPosition',[0 0 12 12])
print -djpeg filename.jpg -r200
Then I am copying this jpeg output into powerpoint to see the effects of modifying -r200 and/or the last argument of the set() function, namely 12 and 12.
What I am noticing is that changing from r100 to r200 does increase the resolution but it also increases the image size when I paste into powerpoint. Setting the image size using the set() function also changes the size but not as expected. For example the above produced an image in Powerpoint which was indeed square but not recognized by powerpoint as 12cm x 12cm. Powerpoint recognized it as being 16.7 cm by 16.7 cm.
I need to produce an image that Powerpoint recognizes as EXACTLY being 12 cm by 12 cm. How do I do this please?

回答(1 个)

Chaitral Date
Chaitral Date 2017-5-9
Set the 'PaperPosition' and 'resolution' properties for the figure as given below to get the image size exactly as 12x12 cm in powerpoint.
set(gcf,'PaperUnits','centimeters','PaperPosition',[0 0 11.5 11.5]);
print -djpeg filename.jpg -r100;
I hope this helps.

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by