MATLAB中设置figure的边框

在matlab的help中,搜索"Automatic Axes Resize",就可以看到调节坐标的几个属性。假设随机生成一张图片100*100,然后保存为png格式,且DPI=300。

   imagesc(rand(100,100));           % generate a random image
   axis off                          % set off the axis
   set(gca, 'position', [0 0 1 1 ]); % the axis must be normalized
   print('-f1', '-r300', '-dpng','xxx.png'); % set the DPI

   这样就得到一张没有边框的图片。


trackback: http://blog.sciencenet.cn/home.php?mod=space&uid=267218&do=blog&id=356262

原文地址:https://www.cnblogs.com/JohnShao/p/2179334.html