linkaxes of subplots with stackedplot

To display
different signals with the same x-axis I used stackedplot. To compare different events of the signals I used subplot to display different stackplots side by side (in columns).
I would like to connect the axes, i.e. when I zoom or move a signal, this is done for all the signals of the other subplots as well.
If I want to use linkaxes, I get the error message "There must be at least one valid axes.
Can anyone help me?
if true
X = [0:4:20];
Y = randi(100,6,3);
hAx(1) = subplot(1, 2, 1);
s = stackedplot(X,Y);
s.title('Plot 1');
hAx(2) = subplot(1, 2, 2);
s = stackedplot(X,Y);
s.title('Plot 2');
end
% linkaxes(hAx, 'x');
linkaxes([hAx(1) hAx(2)],'x')

Answers (0)

Asked:

EK
on 29 Oct 2020

Edited:

EK
on 29 Oct 2020

Community Treasure Hunt

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

Start Hunting!