필터 지우기
필터 지우기

How to lock the axis origin and limits for an axes figure in app designer

조회 수: 6 (최근 30일)
Mustafa Al Homsi
Mustafa Al Homsi 2019년 3월 18일
편집: CHENG QIAN LAI 2020년 11월 24일
I have an app with a axes component. I have manually set the following rules properties: XLim and YLim to fixed values. XLimMode and YLimMode to 'manual' and XAxisLocation and YAxisLocation to 'origin'. When I plot an alphaShape to the axes, the axis are not on the origin an more and the mouse wheel can zoom in and out. How can I lock the axes such that the axis location and limits doesn't change regardless of the data being plotted or user interaction.

답변 (1개)

CHENG QIAN LAI
CHENG QIAN LAI 2020년 11월 23일
편집: CHENG QIAN LAI 2020년 11월 24일
t = linspace(0,10*pi,200);
x = sin(t);
y = cos(t);
hAxes=axes;
line(hAxes,x,y,t)
view(3)
hBehavior = hggetbehavior(hAxes, {'Zoom','Pan','Rotate3d'}); % undocumented
hBehavior(1).Enable=0;
hBehavior(2).Enable=0;
hBehavior(3).Enable=0;
t = linspace(0,10*pi,200);
x = sin(t);
y = cos(t);
hAxes=axes;
line(hAxes,x,y,t)
view(3)
hpan=pan;
hzoom=zoom;
hrot=rotate3d;
setAllowAxesPan(hpan,hAxes,false); % Function to set permission to pan axes.
setAllowAxesZoom(hzoom,hAxes,false);
setAllowAxesRotate(hrot,hAxes,false);
Reference: pan | zoom | rotate3d

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by