Saving Matlab figure(Imagesc) to JPG without White borders

Hi,
I am using imagesc to plot color maps in matlab. While saving as JPG and Figuire it gives white space around the image. Is it possible to save without white space?
imagesc(Subject_Assist_Quest);
set(gca,'YDir','normal')
axis off
Capture.jpg

3 commentaires

Use this command from MATLAB - exportgraphics(gca,fname,'BackgroundColor','none')
When I try this I get: "Warning: Background transparency is not supported; using white instead. " So far I haven't found a workaround.
You can ignore the warning. Is white not OK? Why are you having transparent pixels anyway?

Connectez-vous pour commenter.

 Réponse acceptée

Plus de réponses (1)

Yes, use imwrite:
imwrite(Subject_Assist_Quest, filename);
Do not save image analysis images as JPG or you'll be sorry. Use PNG.

1 commentaire

Sunny
Sunny le 20 Déc 2018
Modifié(e) : Sunny le 20 Déc 2018
Thanks got your point. I will save in PNG.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Centre d'aide et File Exchange

Produits

Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by