Simple question with saving a .jpeg

1 view (last 30 days)
aurc89 on 30 Jan 2015
Commented: aurc89 on 30 Jan 2015
Hi, I have a very simple question about saving images in Matlab. I need to save a plot as a .jpeg and I do this by executing this code:
pcolor(wldf_cut,tau,Iw_cut2),shading interp;
saveas(gca, fullfile(folder_save, 'map_wl'), 'jpeg');
where folder_save is the directory I choose to save this file. The problem is that this code opens the figure before saving it, while I want it so save the plot without opening the figure in a window. How can I do? Thanks P.S. I do this inside a GUI interface and save the image by pressing a button: if I don't write the line
it saves the figure in a wrong way.

Accepted Answer

Julia on 30 Jan 2015
I guess if you write like that
it should solve your problem.
  1 Comment
aurc89 on 30 Jan 2015
It works! Thank you very much!

Sign in to comment.

More Answers (0)


Find more on Printing and Saving in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by