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

조회 수: 34 (최근 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 CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by