User controlled axis limits

2 Ansichten (letzte 30 Tage)
Melvin
Melvin am 7 Jun. 2013
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 7 Jun. 2013
Bearbeitet: Azzi Abdelmalek am 7 Jun. 2013
xl=str2double(get(handles.axes1,'xlim'));
xl2=xl(2)
xlim(handles.axes1,[user_entry xl2]);
  1 Kommentar
Melvin
Melvin am 7 Jun. 2013
This worked perfectly, thank you Azzi.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by