Display a figure on a GUI axes?

조회 수: 2 (최근 30일)
Qingyang
Qingyang 2012년 7월 18일
Hi, is there any way to display an existing figure onto a GUI axes object?

답변 (2개)

Walter Roberson
Walter Roberson 2012년 7월 18일
No. A figure can never be a child of anything other than the root object.
Also, an axes can never be the child of another axes.
It is possible to place images within axes, if that is what you are looking for. Just set() the image Parent property to be the target axes. You might also want to set the image XData and YData properties to move the image around within the axes.
  댓글 수: 8
Qingyang
Qingyang 2012년 7월 19일
Yes, a generated image of a figure would be sufficient for what I need. How do I generate an image of a figure?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2012년 7월 19일
To save a figure as an image to an image file, try the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions. which recommends using export_fig() - the most downloaded File Exchange file.
  댓글 수: 4
Image Analyst
Image Analyst 2012년 7월 20일
Sorry - I guess I misinterpreted when you said "generate an image." Like Walter said, you can use getframe to get the contents of the figure into a variable in your program, but what are you're going to do with it? What's the point, when you already have the data that went into making up the figure? Why obtain that image if you're not planning on saving it out to disk?
Qingyang
Qingyang 2012년 7월 20일
Thanks for your guys' support. I'll be using the getframe method.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by