User controlled axis limits

1 回表示 (過去 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 Center および File ExchangeWord games についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by