How to use draw now over a plot (lifetracking)

조회 수: 10 (최근 30일)
Myrthe B.
Myrthe B. 2017년 6월 18일
댓글: Myrthe B. 2017년 6월 19일
I am trying to refresh a plot using drawnow. This works fine, however, the data need to be plotted over a existing plot. I tried using the hold on statement for this purpose, but in this case, all the points of drawnow are being kept, too. Creating the background plot again in the iritation is not an option, due to the long time it takes to create it. Is there a way to plot over an existing image but be able to track the point in real time?
The code I use:
hold on
for t=1:1:size(data,2)
plot3(data(1,t),data(2,t),data(3,t))
drawnow
end
  댓글 수: 2
KSSV
KSSV 2017년 6월 19일
Don't use hold on
Myrthe B.
Myrthe B. 2017년 6월 19일
Yeay, I figured that one out. The problem is that in that case, the background plot isn't displayed.

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

답변 (1개)

Walter Roberson
Walter Roberson 2017년 6월 19일
Use animatedline()

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by