How to close the extra legend added by comet fun?

조회 수: 1 (최근 30일)
ziyong han
ziyong han 2019년 3월 8일
댓글: KSSV 2019년 3월 8일
I use the comet fun to trace my simdata, however the comet fun added the extra legend data to my fig, see the attached fig that "data1, data2, data3" were added when animating.
How should I close the extra "data1, data2, data3" at the beginning of the animation? BTW, I know how to close it when the animation is finished.
Snipaste_2019-03-08_12-02-39.png

채택된 답변

KSSV
KSSV 2019년 3월 8일
편집: KSSV 2019년 3월 8일
x = 1:100 ;
y = rand(size(x)) ;
figure
h = plot(x,y) ;
hold on
comet(rand(size(x))) ;
legend(h,'one')
  댓글 수: 4
ziyong han
ziyong han 2019년 3월 8일
thanks, it do solve the problem.
But compare to comet, it is slower in my simulation data more than 10000.
Is there a good way to achieve this by comet?
KSSV
KSSV 2019년 3월 8일
as of now to make the plot fast..you can run the loop by skipping some values...you need not to run for every point.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by