Dynamic plot in real time

조회 수: 10 (최근 30일)
Jiaqi Wang
Jiaqi Wang 2023년 1월 27일
답변: Walter Roberson 2023년 1월 28일
I am getting real-time data as shonw in the figure attached. The red and yellow bars are real-time data and are moving higher/lower dynamically according the the magnitude of my data. I want to display this figure as a seasaw. Basically, the left side represents the red bar, and the right side represents the yellow bar. When the red bar has a higher value than the yellow bar, the seasaw should tilt to the left side. The angle of the tilt should reflect the difference between the red and yellow bar. Is there any way to achieve this?
  댓글 수: 1
prasanth s
prasanth s 2023년 1월 28일
is any example image for how output look like?

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

답변 (1개)

Walter Roberson
Walter Roberson 2023년 1월 28일
pick nominal x coordinates for the endpoints of the see-saw. Create a line that has those as the x coordinates and has the "current" (or possibly time-averaged) values of left and right as the y coordinates. As you get new data, update the YData of the line with the appropriate values. You do not need to do anything explicit about the angle: the angle will naturally exist as the y coordinates change.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by