Copy matlab figure in Libreoffice in Linux

12 Ansichten (letzte 30 Tage)
JD
JD am 14 Okt. 2019
Bearbeitet: Richard Quist am 4 Mai 2022
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 Kommentare
Nicolas B.
Nicolas B. am 15 Okt. 2019
Personnaly, because Libre Office is supporting you to write a report, I would export into an image, like a png (see the export documentation).
Himanshu Giria
Himanshu Giria am 3 Mai 2022
Why not save it to pdf

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Richard Quist
Richard Quist am 4 Mai 2022
Bearbeitet: Richard Quist am 4 Mai 2022
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.

Kategorien

Mehr zu Printing and Saving 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!

Translated by