필터 지우기
필터 지우기

How to link axes from a loop generated subplot?

조회 수: 46 (최근 30일)
Richard Reees
Richard Reees 2019년 4월 5일
답변: a. alhufari 2022년 7월 4일
Good afternoon everyone,
I am trying to link the axes of a subplot generated from a looped set of data. The code generated the correct graphs and their positions, the one thing I cannot get to work is the linking of the axes together as an error is show "There must be at least one valid axes". I have tried as many permenations of the code as I can, and have left the final attempt below
VelMod = velocities(:,[4 1 2 5 3]);
velName = {'Y104min100','Y288min287','Y421min420','Y100min96','Y287min286'};
for ii =1:size(VelMod,2)
subplot(2,3,ii)
if ii == 3
subplot(2,3,6);
delete(subplot(2,3,3));
end
plot(min, VelMod(:,ii))
title(velName(ii), 'Fontsize', 8);
end
linkaxes(VelMod(ii), 'xy');
. Help would be greatly appreciated.
  댓글 수: 1
Dhanashree Mohite
Dhanashree Mohite 2019년 4월 12일
Can you provide more details like what is velocities matrix and min?

댓글을 달려면 로그인하십시오.

답변 (1개)

a. alhufari
a. alhufari 2022년 7월 4일
for i =1:size(VelMod,2)
ax(i)=subplot(2,3,i);
plot(min, VelMod(:,i))
title(velName(ii), 'Fontsize', 8);
linkaxes(ax,'xy')
end

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by