Changing plot orientation ruins zoom capabilities
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to plot data in a gui. I want the Y axis to be horizontal, and the X axis to be vertical, and I want to be able to zoom in on the plot like normal.
Zoom works normally when running the following code segment.
numPlots = 1;
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 next 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). The new zooming increases the size of the whole axes, rather than changing the scale of the axes. 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' to change orientation, and I tried moving the set() after the first plot(). I tried using versions 2009 and 2010. Nothing had an effect. It is possible that this problem is related to this thread:
Anyone know how I could either fix zoom, or change the plot orientation without messing up zoom?
댓글 수: 0
답변 (1개)
참고 항목
카테고리
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!