Saving Matlab figure(Imagesc) to JPG without White borders

24 次查看(过去 30 天)
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 个评论
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
Look at this file

更多回答(1 个)

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

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by