Why does the aspect ratio of a figure change after copy pasting the figure in PowerPoint using "Copy Figure" in MATLAB R2025a?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 3 Okt. 2025
Beantwortet: MathWorks Support Team
am 10 Okt. 2025 um 13:28
In previous versions of MATLAB (R2024b and earlier), when I copied a figure and pasted it into PowerPoint, the aspect ratio matched the one I had set.
The expected behavior is that copying a MATLAB figure and pasting it into PowerPoint should preserve the aspect ratio. However, what I observe in MATLAB R2025a is that the aspect ratio is not maintained when I paste the figure into PowerPoint.
Here is an example of the aspect ratio difference I noticed after pasting the figure into PowerPoint (with "Match on-screen size" enabled):
set(gcf, "units", "inches", "position", [0, 0, 6, 4])
I would expect the figure to have an aspect ratio of 1.5 (6-by-4), but in PowerPoint, it appears as 1.405 (6-by-4.27).
How can I ensure that the figure I copy into PowerPoint keeps exactly the same aspect ratio as I have set in MATLAB R2025a?
Akzeptierte Antwort
MathWorks Support Team
am 3 Okt. 2025
The difference that you are seeing between MATLAB R2025a and earlier versions is due to changes in how MATLAB copies figures. In MATLAB R2025a, MATLAB uses a new method for copying figures that crops the image more tightly by default, which can change the aspect ratio compared to previous versions.
At this time, the Copy Figure tool in MATLAB R2025a does not let you adjust this cropping, so the aspect ratio might not match what you set in the figure window.
However, as a workaround, you can get the old behavior by using a command in MATLAB called “copygraphics”.
If you run the following command in the MATLAB Command Window:
copygraphics(gcf, 'Padding', 'figure')
It will copy the figure with the same aspect ratio as before.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!