方法一:
可以通过将imshow函数属性”Border’的值设置为’tight’,而imshow的默认值为’loose’,然后通过figure1-文件-另存为的方式将图片进行保存:
imshow(img,'Border','tight');
方法二:
imshow(img,'Border','tight');
set(gcf,'color','white','paperpositionmode','auto');
saveas(gcf,'exprimentLightBundles.eps','psc2');
%或者
imshow(img,'Border','tight');
set(gcf,'color','white','paperpositionmode','auto');
saveas(gcf,'example','bmp');%png等等