Borrar filtros
Borrar filtros

how to save a plot ?

11 visualizaciones (últimos 30 días)
Hassan
Hassan el 19 de Jun. de 2011
I have two large data sets. Usually it takes a lot of time to save a plot on hard drive. I wonder how I can save a plot as jpeg file in a quick way. Usually it takes a lot of time to save a plot on hard drive. I apperciate your help.
saveas(gcf,'C:\plot.jpg')
delete(gcf)
  5 comentarios
Walter Roberson
Walter Roberson el 19 de Jun. de 2011
save() is the counterpart of load()
http://www.mathworks.com/help/techdoc/ref/save.html
It stores the data instead of the image, so whether it is useful to you depends on what you need to do afterwards.
Hassan
Hassan el 20 de Jun. de 2011
I see, it's not the one I need then.

Iniciar sesión para comentar.

Respuestas (2)

Jan
Jan el 19 de Jun. de 2011
I guess that it is not the saving, but the drawing of the plot, which consumes the most time. "delete(gcf)" means, that you create a new figure for each plot. This is much slower than using the same figure and only update the axes object, or even better: Keep the axes also and update just the children.
So please insert a DRAWNOW before the method for sving and use the PROFILEr to find the most time consuming lines.
  6 comentarios
Walter Roberson
Walter Roberson el 19 de Jun. de 2011
So effectively the bulk of the time is being used in the built-in function toolbox/matlab/graphics/hardcopy which is being called by the plot renderer.
Hassan
Hassan el 20 de Jun. de 2011
it take longer than it shows on profiler. I tried that and when I dont save the plot, it's much faster (although not quite fast).

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 19 de Jun. de 2011
There is a possibility that Oliver's export_fig might be faster; it's worth a try.
  3 comentarios
Walter Roberson
Walter Roberson el 19 de Jun. de 2011
Hmm... what kind of scene elements do you use? If you do not have transparency, then _possibly_ changing the renderer property of the figure or the drawmode property of axes could help. Unfortunately I do not know how rendering is done for saving images, so these things might not make any difference.
Hassan
Hassan el 19 de Jun. de 2011
sorry Walter, I didnt understand the meaning of scene elements, transprancy and renderer. but will have a look at them.

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations 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