How can I save only content of matlab figure ?

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.

Answers (2)

x = rand(20,1) ;
y = rand(20,1) ;
plot(x,y)
set(gca,'LooseInset',get(gca,'TightInset'));
saveas(gcf,'junk.jpg')

1 Comment

thanks for your answer... Not plot! I want to save from figure,imshow() without white border

Sign in to comment.

Tags

Answered:

on 9 Feb 2017

Community Treasure Hunt

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

Start Hunting!