Toolbar zoom button increases size of map instead of zooming in
조회 수: 7 (최근 30일)
이전 댓글 표시
I'm working on someone else's code and running into a problem. A figure is created and two different graphs are placed on it - a map (axesm command) and a x-y graph (axes command). Everything in the map is being drawn correctly to start. When the user selects the zoom button in the toolbar and clicks on the map, though, the entire map increases in size instead of zooming in. And that means it overwrites the x-y graph below it, which I need to be able to see as I'm zooming in.
How can I fix the graph size so that the zoom function really just zooms in? I know I'm not giving enough information here, but I'm not sure how much of the code is relevant and don't want to post a giant code list that's meaningless.
Any help would be greatly appreciated! Thanks so much.
Michael
댓글 수: 0
답변 (6개)
Jan
2011년 7월 19일
The difference between zooming and increasing the size is that for the later the pixels outside the axes rect are not clipped. Therefore I assume, that the Clipping property of the map is disabled in Matlab 2011 for unknown reasons. So please check:
get(ma, 'Clipping')
or whatever is the correct method to get the properties of the underlying image(?) object.
댓글 수: 0
Paul
2011년 7월 27일
I have a similar problem, (occurs in 2009 and 2010 versions). Problem occurs after setting some axes properties.
Zoom works normally when running the following code segment.
newHandle = figure(numPlots);
plot(X_pos,Y_pos,'r');
hold on;
plot(ord_X,ord_Y,'*');
hold off;
newAxes = get(newHandle,'CurrentAxes');
However, after this line, zoom behavior changes.
set(newAxes,'View',[-90, 90],'YDir','Reverse');
With the new zoom behavior, single left-click does nothing, and boxing an area isn't allowed. To zoom in, you hold the left mouse button and drag up or to the right (down or to the left zooms out). Additionally with the new zoom behavior, sometimes double clicking changes the angle the axes is viewed, and changes zoom back to normal.
Clipping is on, i tried changing the order of the children in the axes, i tried using cameraUpVector rather than using view, and I tried moving the set() after the first plot.
Anyone know how I could either fix zoom, or change the plot orientation without messing up zoom?
댓글 수: 0
HANS
2018년 1월 25일
I need help in zoom.
After typed "set(newAxes,'View',[-90, 90]);"
then zoom is almost corrupted like single left-click does nothing, and boxing an area isn't allowed. To zoom in, you hold the left mouse button and drag up or to the right (down or to the left zooms out).
The situation is same as thethe last comment before mines above.
Please could anybody help me to fix it ?
Thx, WR
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!