Zoom on multible figure at the same time

조회 수: 12 (최근 30일)
Steen
Steen 2023년 11월 30일
답변: Pratyush Swain 2023년 12월 11일
How to zoom in on all figure´s at the same time

답변 (1개)

Pratyush Swain
Pratyush Swain 2023년 12월 11일
Hi Steen,
I understand you want to zoom in on all figures at the same time. For this purpose, we have to link the axes of all the figures together and set common axes limits .
Please follow the example implementation for the same.
% Create the first figure and plot in it
fig1 = figure;
plot(1:10, rand(1,10)); % Example plot
ax1 = gca; % Get the axes of the first figure
% Create the second figure and plot in it
fig2 = figure;
plot(1:10, rand(1,10)); % Example plot
ax2 = gca; % Get the axes of the second figure
%Create the third figure and plot in it
fig3 = figure;
plot(1:10, rand(1,10)); % Example plot
ax3 = gca; % Get the axes of the third figure
% Create the fourth figure and plot in it
fig4 = figure;
plot(1:10, rand(1,10)); % Example plot
ax4 = gca; % Get the axes of the fourth figure
linkaxes([ax1, ax2 , ax3, ax4], 'xy'); % Link the x and y axes of all the axes
% Set common axes limits
xlim(ax1, [1,10]); % Set the x-axis limits
ylim(ax1, [0, 1]); % Set the y-axis limits
On replicating the example above on matlab, you will be able to zoom in all figures simultaneously.
For more information, please refer to documentation of 'linkaxes' function:
Hope this helps.

카테고리

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

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by