copygraphics has extra padding when copying with "ContentType" as "vector".

20 Ansichten (letzte 30 Tage)
Jay
Jay am 30 Jan. 2026 um 22:33
Hi,
I am using copy graphics to copy my figures. I am running into a problem though.
figure;
plot(randn(5,1));
copygraphics(gcf, "ContentType","vector")
Will copy a plot that looks like this when pasted into microsoft Word:
Notice the extra padding at the bottom and on the right.
If I do the same code but with the image content type:
figure;
plot(randn(5,1));
copygraphics(gcf, "ContentType","image")
Then the resulting pasted image has no padding:
Note: the "Padding" option works, but when I add a "Padding" of 60 then I still have more padding on the right and bottom of the image.
I tried pasting it into another program, Inkscape, and it didn't have the padding error. So it must be something to do with microsoft Word (and OneNote as well). I also can copy the axes from the toolstrip and it has the same padding error.
This error only occurs in Matlab 2025b. I also tried it in Matlab 2022a and that error is gone. So it must be something with the newer versions of matlab and it is something that matlab workers could fix.
If anyone has any idea what is going on that would be great.

Antworten (0)

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Produkte


Version

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by