"hold on" equivalent in GUIDE

조회 수: 2 (최근 30일)
Farbos de Luzan
Farbos de Luzan 2018년 2월 21일
댓글: Rik 2018년 3월 2일
Hello all,
When I update my plot in GUIDE, the imline lines that were previously defined disappear. Is there a way to make them permanent by using an equivalent of "hold on"? Or do I have to re-plot, everything, every time I change something to my plot? Thank you in advance!
  댓글 수: 2
Arvind Narayanan
Arvind Narayanan 2018년 3월 2일
Have you tried using drawnow command?
Adam
Adam 2018년 3월 2일
What do you mean by 'when I update my plot in GUIDE'? GUIDE is just a GUI design tool, it doesn't run anything or include plots in it.

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

채택된 답변

Farbos de Luzan
Farbos de Luzan 2018년 3월 2일
Just to clarify, I had my imline plotted on some axes, then I would plot an image on these axes, and my imline would "disappear". It turns out that it was still there, only hidden behind the image.
Adding something like
uistack(imline_handle,'top')
solved it!
Thank you all for your help!
  댓글 수: 1
Rik
Rik 2018년 3월 2일
My point holds for imline as well. You can specify a parent, so you should. Not specifying parent objects in GUIs will cause problems at some point that you will not be able to debug. It is a pain, but it is a vital step in finalizing code. Alternatively, you can force the axes to be the current axes with axes(handles.ax).

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

추가 답변 (1개)

Rik
Rik 2018년 3월 2일
You should always specify the axes you want to affect, so you can use hold(handles.ax,'on').
GUIDE is just a shell around 'normal' Matlab, so anything that works as a function should work in a function created by GUIDE as well.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by