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

31 ビュー (過去 30 日間)
Jay
Jay 2026 年 1 月 30 日 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.

回答 (0 件)

カテゴリ

Help Center および File ExchangeDownloads についてさらに検索

製品


リリース

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by