Saving a matlab figure file without displaying it

25 visualizaciones (últimos 30 días)
TP Das
TP Das el 3 de Feb. de 2015
Comentada: Benjamin Abruzzo el 28 de Mayo de 2020
Usually I generate a matlab plot using plot command and then save it for offline viewing. When I have to do the same for, say, 1000 plots, displaying each of them before saving becomes time consuming. Is there a way to save a matlab plot as jpeg without displaying it?

Respuesta aceptada

Titus Edelhofer
Titus Edelhofer el 3 de Feb. de 2015
Hi,
you might open the figure invible:
f = figure('visible', 'off');
surf(peaks);
print -djpeg test.jpg
close(f)
It will still take some time, though.
Titus

Más respuestas (2)

Blanca Larraga
Blanca Larraga el 4 de Jun. de 2018
Hi, I do this but the .jpeg are empty. Is there anything else I should consider?

Y. J.
Y. J. el 26 de Jul. de 2018
Hey I have a similiar problem. I'm plotting in a invisible figure in the first time that works good but if I want to hold on the plot and plot another one in it, it is overwriting the first plot? Any Idea for that?
  1 comentario
Benjamin Abruzzo
Benjamin Abruzzo el 28 de Mayo de 2020
Thy this
f = figure('visible', 'off');
X = rand(10,1); Y = rand(10,1); Z = rand(10,1);
hold on
plot(X,Y)
plot(X,Z)
plot(Y,Z)
hold off
print -djpeg test.jpg
close(f)

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Identification en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by