Zoom on multible figure at the same time
조회 수: 12 (최근 30일)
이전 댓글 표시
How to zoom in on all figure´s at the same time
댓글 수: 1
Mathieu NOE
2023년 12월 11일
편집: Mathieu NOE
2023년 12월 11일
either use xlim on all plots or this : Synchronize limits of multiple axes - MATLAB linkaxes - MathWorks France
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
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!