필터 지우기
필터 지우기

plot over writing on gui

조회 수: 3 (최근 30일)
Jerry Gregoire
Jerry Gregoire 2015년 6월 4일
댓글: Adam 2015년 6월 5일
I have a GUI that calls a plot function (via a timer) that plots in a separate figure. Occasionally the plot overlays the GUI. I am plotting to the axes, so this should not happen. Example:
plot(hAxes(i), XData, YData);
Here is a repeatable scenario: The timer is repeatedly plotting on a given axes, when I press a UI button, the GUI gets overlaid with the plot just as or before the callback is executed. (I put a dbstop at the beginning of the callback. The GUI would still be overwritten even without the dbstop. It's as if ML gets confused when the GUI figure is made current, even though the plot axes is specified.
Any ideas?
  댓글 수: 4
Jerry Gregoire
Jerry Gregoire 2015년 6월 4일
Hi Geoff, Adam
I figured out what is happening. I was executing a 'hold off' command unnecessarily in my timer function, (it was in a previous utility I had written). The hold off command added an axes to my GUI. It looked like a plot but was empty. Apparently hold off does more than just instruct Matlab for the next axis update, it immediately creates a fresh axis in the figure.
Thanks for your ideas.
Adam
Adam 2015년 6월 5일
Yes, I have been caught by that a few times. hold off will create an axes specially to turn their hold status off if it doesn't have an active axes on the current figure!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by