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!