Can we add a vertical slider to trace points in a linked axis plot?

조회 수: 1 (최근 30일)
I would like to create plots in a MATLAB figure, similar to Simulink scope output with multiple inputs, where the different plots are linked together. Specifically I wish to know how to implement a feature like the Trace selection in the Simulink scope where the vertical line highlights the y-axis value for same x-axis point for all the plots.
While linkaxes solves part of the problem and allows me to zoom the subplots simultaneously in a synchronised manner
linkaxes(axis,'x')
I still have to use datatip to manually select values in the different plots. Is there a way which would highlight the y-values in all the plots, given that x-axis has been selected in any one of them? Exactly what a Simulink scope does under Trace mode.

채택된 답변

Kevin Holly
Kevin Holly 2022년 11월 4일
편집: Kevin Holly 2022년 11월 4일
You could use stackedplot.
  댓글 수: 5
Kevin Holly
Kevin Holly 2022년 11월 4일
tbl = readtable("patients.xls","TextType","string");
h = stackedplot(tbl,["Height","Weight","Systolic","Diastolic"]);
ax = findobj(h.NodeChildren, 'Type','Axes');
ax(1).Title.String = 'Axes 4';
ax(2).Title.String = 'Axes 3';
ax(3).Title.String = 'Axes 2';
ax(4).Title.String = 'Axes 1';
Manish Kumar Nayak
Manish Kumar Nayak 2022년 11월 5일
편집: Manish Kumar Nayak 2022년 11월 5일
This is it. Thank you.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by