User controlled axis limits

조회 수: 3 (최근 30일)
Melvin
Melvin 2013년 6월 7일
I have a working code that allows the user to control the axes limits in a GUI figure. The only problem is, let's say I'd like to change my x limits. When I change the lower limit it works perfectly fine, but when I change the upper limit, the lower limit autoscales to its original value. I'm using this line to control my edit-text boxes:
xlim(handles.axes1,[user_entry Inf]);
Is there anything else besides 'Inf' I could use so that the other limit stays the same? Thanks in advance

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 7일
편집: Azzi Abdelmalek 2013년 6월 7일
xl=str2double(get(handles.axes1,'xlim'));
xl2=xl(2)
xlim(handles.axes1,[user_entry xl2]);
  댓글 수: 1
Melvin
Melvin 2013년 6월 7일
This worked perfectly, thank you Azzi.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by