Gui Guide axes update limits

조회 수: 11 (최근 30일)
Septimus Boshoff
Septimus Boshoff 2020년 4월 8일
댓글: Septimus Boshoff 2020년 4월 11일
Hi I have a Gui I created using Guide.
How would I dynamically update the axes limits using a timer?
I have data being read in and displayed. The x axes limits need be set each time the data is updated when the timer calls the update
function GUIUpdate(obj,event,handles)
global x y1
handles.plot = plot(handles.axes1,x,y1);
% What I have tried...
ax = get(handles.plot,'Parent')
b.xlim([x(1) x(cols_of_data)])
axes(handles.axes1);
xlim([x(1) x(cols_of_data)])
  댓글 수: 5
Rik
Rik 2020년 4월 10일
Global variables are almost always a bad idea. If you are absolutely certain you need them (you probably don't), then their names are way too short. You should be giving them very long names that include the function name. That way the chances of some other function using the same name for their global function are minimized.
Septimus Boshoff
Septimus Boshoff 2020년 4월 11일
True, thanks for pointing out better coding practice.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by