【问题标题】:How to save contourf figure to image (.jpg) using matlab?如何使用matlab将轮廓图保存到图像(.jpg)?
【发布时间】:2019-05-29 17:13:52
【问题描述】:

我想将轮廓图保存到图像 (.jpg)。我尝试使用 saveas(gcf, output, 'jpg'),结果是空白的 .jpg 文件。你能帮我把 plot contourf 保存在我的电脑里吗?

contourf(L, jml_level)
colormap autumn
figure

This is result of contourf

谢谢。

【问题讨论】:

  • 你试过print -djpeg filename吗?
  • 我不确定你是否理解我想说的。您已经尝试了saveas 命令。您是否也尝试过print 命令?您也可以使用该命令将图形保存为 JPEG 文件。
  • 我尝试使用打印命令,结果是相同的空白 jpg
  • 等等,当你做saveas(gcf,...)时,你有没有相关的数字作为当前的数字?您在绘图位置显示的代码以figure 结尾。这将创建一个新的空图。 gcf 现在是那个空的数字。请确保您没有保存这个空图。
  • 感谢您的帮助!

标签: image matlab plot contourf


【解决方案1】:

您可以使用图形句柄来指示要保存的图形

fig1 = figure;
contourf(L, jml_level)
colormap autumn
saveas(fig1,'cont.png')

【讨论】:

    猜你喜欢
    • 2013-07-01
    • 2018-02-12
    • 1970-01-01
    • 2021-01-05
    • 2015-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-03
    相关资源
    最近更新 更多