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

60 visualizaciones (últimos 30 días)
Riyadh Muttaleb
Riyadh Muttaleb el 2 de Mayo de 2016
Comentada: Walter Roberson el 28 de En. de 2023
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 comentarios
Riyadh Muttaleb
Riyadh Muttaleb el 2 de Mayo de 2016
Editada: Riyadh Muttaleb el 2 de Mayo de 2016
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 el 14 de Oct. de 2019
Hi the question is: the moment you have a file.fig and you want to convert it

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Mayo de 2016
figs = openfig('TheFigFile.fig');
for K = 1 : length(figs)
filename = 'figure_%02d.jpg';
saveas(figs(K), filename);
end
  5 comentarios
Riyadh Muttaleb
Riyadh Muttaleb el 20 de Dic. de 2016
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 el 20 de Dic. de 2016
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.

Iniciar sesión para comentar.

Más respuestas (4)

Sanjeev kumar
Sanjeev kumar el 12 de Ag. de 2022

Azzi Abdelmalek
Azzi Abdelmalek el 2 de Mayo de 2016
Editada: Azzi Abdelmalek el 2 de Mayo de 2016
  1 comentario
Riyadh Muttaleb
Riyadh Muttaleb el 3 de Mayo de 2016
thank you, I used it, but the problem how can I do loop for saving? I tried many stuff but didn't work!

Iniciar sesión para comentar.


Bahamut Zero
Bahamut Zero el 10 de Ag. de 2017
Editada: Bahamut Zero el 10 de Ag. de 2017
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 el 28 de En. de 2023
figs = openfig('TheFigFile.fig');
for K = 1 : length(figs)
filename = 'figure_%02d.jpg';
saveas(figs(K), filename);
end
  1 comentario
Walter Roberson
Walter Roberson el 28 de En. de 2023
I posted that more than 6 years ago, and it had a mistake that was corrected later.

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by