How can I convert 'file.fig' to to jpg?

조회 수: 60 (최근 30일)
Riyadh Muttaleb
Riyadh Muttaleb 2016년 5월 2일
댓글: Walter Roberson 2023년 1월 28일
I have 'file.fig' that consists from 50 figures. I would like to convert them to jpeg. How can I do that?
Thanks
Riyadh
  댓글 수: 3
Riyadh Muttaleb
Riyadh Muttaleb 2016년 5월 2일
편집: Riyadh Muttaleb 2016년 5월 2일
thank you so much for your reply, I have individual 50 figures, so I would like to save them separately.
Miguel Rodriguez Talaveron
Miguel Rodriguez Talaveron 2019년 10월 14일
Hi the question is: the moment you have a file.fig and you want to convert it

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 2일
figs = openfig('TheFigFile.fig');
for K = 1 : length(figs)
filename = 'figure_%02d.jpg';
saveas(figs(K), filename);
end
  댓글 수: 5
Riyadh Muttaleb
Riyadh Muttaleb 2016년 12월 20일
Hello Walter,
I have two files (.fig)..How can I covert them to jpg at came time?
Thanks in advance
Riyadh
Walter Roberson
Walter Roberson 2016년 12월 20일
If they need to appear together in the same image, then save them as png or tif, read the png (or tif) and combine the images in an appropriate way, such as horzcat or vertcat or perhaps imagepatch. Then save that result into an appropriate file format.
Use png or tiff as the intermediate format so that you do not end up losing information twice from the JPEG lossy compression.

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

추가 답변 (4개)

Sanjeev kumar
Sanjeev kumar 2022년 8월 12일

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 2일
편집: Azzi Abdelmalek 2016년 5월 2일
  댓글 수: 1
Riyadh Muttaleb
Riyadh Muttaleb 2016년 5월 3일
thank you, I used it, but the problem how can I do loop for saving? I tried many stuff but didn't work!

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


Bahamut Zero
Bahamut Zero 2017년 8월 10일
편집: Bahamut Zero 2017년 8월 10일
You can download a tool for converting a folder of .fig to .jpeg en masse here. Just make sure you have the correct MATLAB Runtime Compiler (license not required).

MATCHA SIVA KUMAR
MATCHA SIVA KUMAR 2023년 1월 28일
figs = openfig('TheFigFile.fig');
for K = 1 : length(figs)
filename = 'figure_%02d.jpg';
saveas(figs(K), filename);
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 1월 28일
I posted that more than 6 years ago, and it had a mistake that was corrected later.

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

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by