Question concerning Xlim and Zoom
2 views (last 30 days)
Show older comments
Hi Guys, I'm working on a GUI which includes a figure. For this figure I added two textboxes for xmin and xmax and set the limits fix to these limits using XLim. I want that the zoom function will not zoom out of theses limits. But I found a problem using the zoom-function: when I first zoom in and then out again, the figure is leaving these limits. BUT: when I try to zoom out first nothing happens. After this first zoom-out I can zoom in and out without leaving the given limits. Does anybody know, why? Here's my Code:
if get(handles.xBorder,'Value')==1
xMin=evalin('base','xMin');
xMax=evalin('base','xMax');
axes(handles.xyPlot)
set(gca,'XLim',[xMin xMax])
elseif get(handles.xBorder,'Value')==0
set(gca,'XLim',[1 10])
end
xBorder is a clickbox which turn the limits on/off. At the moment the program reads the limits out of the base workspace - I changed it for debugging. I will afterwards change it back.
0 Comments
Answers (0)
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!