How can I save only content of matlab figure ?

43 次查看(过去 30 天)
i am using the following code: fig=figure,imshow(RIm); saveas(fig,'22.jpg');
It saves as image but with white border. How can I save only content of the figure.

回答(2 个)

KSSV
KSSV 2017-2-8
x = rand(20,1) ;
y = rand(20,1) ;
plot(x,y)
set(gca,'LooseInset',get(gca,'TightInset'));
saveas(gcf,'junk.jpg')
  1 个评论
K M Ibrahim Khalilullah
thanks for your answer... Not plot! I want to save from figure,imshow() without white border

请先登录,再进行评论。


James Tursa
James Tursa 2017-2-9
You might check out this FEX submission by Yair Altman:

标签

Community Treasure Hunt

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

Start Hunting!

Translated by