Copy matlab figure in Libreoffice in Linux

I am using Linux. I have a matlab figure that I need to copy and paste directly into Libre Office Linux. There is no "copy figure" option in the edit drop down list like there is in Windows. Any suggestion?

댓글 수: 4

Walter Roberson
Walter Roberson 2019년 10월 14일
When it is inside LibreOffice does it need to be interactive? Zoom and rotate?
JD
JD 2019년 10월 14일
No need to have the figure be interactive in Libre Office. No need to rotate and zoom.
Nicolas B.
Nicolas B. 2019년 10월 15일
Personnaly, because Libre Office is supporting you to write a report, I would export into an image, like a png (see the export documentation).
Why not save it to pdf

댓글을 달려면 로그인하십시오.

답변 (1개)

Richard Quist
Richard Quist 2022년 5월 4일
편집: Richard Quist 2022년 5월 4일

0 개 추천

There are a couple options for copying the figure to the clipboard on Linux.
For recent versions of MATLAB (R2020a or later) you can use the copygraphics command:
% This example assumes that 'fig' is the handle to your figure.
% In R2020a and later, you can use the copygraphics command and specify
% the 'ContentType' as 'vector' (to ensure tightly cropped, scalable output):
copygraphics(fig, 'ContentType', 'vector');
For older versions (since R2016a, I think) you can use the print command with the -clipboard option
% This example assumes that 'fig' is the handle to your figure.
% Use the print command and specify the -clipboard option and desired
% format
% Specify -dpdf and '-painters' to ensure scalable output
print(fig, '-clipboard', '-dpdf', '-painters');
% or specify -dbitmap to copy as an image
print(fig, '-clipboard', '-dbitmap');
I hope that helps.

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

질문:

JD
2019년 10월 14일

편집:

2022년 5월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by