필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Problem on working with timer object to refresh an axes on a GUI

조회 수: 1 (최근 30일)
RZM
RZM 2016년 5월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
I am dealing with timer object in the MATLAB GUI. Assume that we have two axes on a GUI and under display update function we plot on each axes separately. The problem here is that when the plot function executes the hObject properties changes like this: before plot execution:
get(hObject,'Children')
ans =
3x1 graphics array:
UIControl (startbutton)
Axes (axes1)
Axes (axes2)
After plot execution axes1 disappears.
plot(x,y,'LineWidth',1,'Marker','o','MarkerFaceColor','b','LineStyle','none')
K>> get(hObject,'Children')
ans =
3x1 graphics array:
UIControl (startbutton)
Axes
Axes (axes2)
So when the timer gets to the refreshing time (and the execution of display update function), a new figure is ploted and each period only that plot updates not the axes1 on the GUI.

답변 (1개)

Geoff Hayes
Geoff Hayes 2016년 5월 25일
RZM - I think that we would need to see more of your code (that in the timer callback) to get a better idea of what may be going wrong. For example, what is hObject?
As for the plot not being displayed in the correct axes, why not specify the axes that you wish to display the plot in? Your code is
plot(x,y,'LineWidth',1,'Marker','o','MarkerFaceColor','b','LineStyle','none')
If you want to plot x and y in axes1, then specify it as
plot(handles.axes1,x,y,'LineWidth',1,'Marker','o','MarkerFaceColor','b','LineStyle','none')

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by