Effacer les filtres
Effacer les filtres

Simple question with saving a .jpeg

2 vues (au cours des 30 derniers jours)
aurc89
aurc89 le 30 Jan 2015
Commenté : aurc89 le 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:
hf1=figure;
pcolor(wldf_cut,tau,Iw_cut2),shading interp;
xlabel('Time')
ylabel('Signal');
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
hf1=figure;
it saves the figure in a wrong way.

Réponse acceptée

Julia
Julia le 30 Jan 2015
Hi,
I guess if you write s.th. like that
hf1=figure('Visible','Off')
it should solve your problem.
  1 commentaire
aurc89
aurc89 le 30 Jan 2015
It works! Thank you very much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Display Image dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by