How to save MATLAB figure as JPEG using saveas() without the image coming off badly?

前端 未结 3 1087
[愿得一人]
[愿得一人] 2020-12-30 00:45

In a MATLAB function I am writing, I am generating a figure. The figure is displayed when the function is executed. I need to save the figure as a JPEG image. To do that, I

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-30 01:10

    I had the same problem, and here is what I used to solve it:

    set(gcf,'PaperPositionMode','auto') saveas(gcf,'file_to_save','png')

    where gcf can be replaced by the handle to the desired figure.

提交回复
热议问题