Changing plot orientation ruins zoom capabilities

조회 수: 4 (최근 30일)
Paul
Paul 2011년 8월 24일
답변: HANS 2018년 1월 25일
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?

답변 (1개)

HANS
HANS 2018년 1월 25일
Hi to everybody,
I need help regarding to this topic.
Thx, WR

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by