Zoom in and zoom out

조회 수: 9 (최근 30일)
Mohamed Kareem
Mohamed Kareem 2021년 4월 22일
답변: Tejas 2025년 7월 15일
in graph in app designer, How can i make zoom in and zoom out for y axis only with out zoom for x axis?

답변 (1개)

Tejas
Tejas 2025년 7월 15일
Hello Mohamed,
To restrict the zoom option along y-axis, use the "zoom" function. For more information on this function, refer to this documentation: https://www.mathworks.com/help/matlab/ref/matlab.graphics.interaction.internal.zoom.html#mw_93cea585-4eee-4991-b400-aa1250c170d1 .
Here is a simple example showcasing the desired workflow:
  • Consider the below plot using "uiaxes" object.
x = linspace(-pi,pi,50);
y = 5*sin(x);
plot(app.UIAxes,x,y);
  • Start by disabling the default interactivity options of the plot.
disableDefaultInteractivity(app.UIAxes);
  • Followed by restricting the zoom option to y-axis only.
zoom(app.UIFigure, 'yon');

카테고리

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