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 件のコメント

Gyaneshwar dubacharla
Gyaneshwar dubacharla 2020 年 8 月 9 日
Use this command from MATLAB - exportgraphics(gca,fname,'BackgroundColor','none')
Elinor Kath
Elinor Kath 2021 年 3 月 16 日
When I try this I get: "Warning: Background transparency is not supported; using white instead. " So far I haven't found a workaround.
Image Analyst
Image Analyst 2021 年 3 月 16 日
You can ignore the warning. Is white not OK? Why are you having transparent pixels anyway?

サインインしてコメントする。

 採用された回答

Mark Sherstan
Mark Sherstan 2018 年 12 月 20 日

0 投票

Look at this file

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 12 月 20 日

0 投票

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

1 件のコメント

Sunny
Sunny 2018 年 12 月 20 日
編集済み: Sunny 2018 年 12 月 20 日
Thanks got your point. I will save in PNG.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

製品

リリース

R2018a

質問済み:

2018 年 12 月 20 日

コメント済み:

2021 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by