【问题标题】:save plot into image file in matlab: difference between saveas and print在matlab中将绘图保存到图像文件中:saveas和print之间的区别
【发布时间】:2011-01-30 01:40:37
【问题描述】:

我想知道在matlab中将绘图保存到图像文件时,saveas和print有什么区别?什么情况下两者都可以用,什么情况下只能用一个?

感谢和问候!

【问题讨论】:

    标签: image matlab printing save-as


    【解决方案1】:

    我相信 SAVEAS 只是 PRINT 的包装。查看 SAVEAS(编辑 saveas)的源代码 - 大量参数检查,最后只有一个打印行。这两个函数都支持相同的格式。 SAVEAS 的语法更简单一些。

    来自 SAVEAS 备注:"If you want to control the size or resolution of figures saved in image (bitmapped) formats (such as BMP or JPG), use the print command."

    【讨论】:

      【解决方案2】:

      打印在其他方面也更加灵活。查看文档页面进行打印 - 您可以复制到剪贴板(例如使用“print -dmeta”),当然也可以打印到打印机。

      【讨论】:

        【解决方案3】:

        改用 hgexport,如下:

        hgexport(gcf, 'figure1.jpg', hgexport('factorystyle'), 'Format', 'jpeg');
        

        来源: http://www.mathworks.com/support/solutions/en/data/1-1PT49C/index.html?product=SL&solution=1-1PT49C

        【讨论】:

          猜你喜欢
          • 2016-11-06
          • 1970-01-01
          • 1970-01-01
          • 2011-12-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-06-15
          相关资源
          最近更新 更多