MATLAB Answers

How to close the extra legend added by comet fun?

5 views (last 30 days)
ziyong han
ziyong han on 8 Mar 2019
Commented: KSSV on 8 Mar 2019
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.

Accepted Answer

KSSV on 8 Mar 2019
Edited: KSSV on 8 Mar 2019
x = 1:100 ;
y = rand(size(x)) ;
h = plot(x,y) ;
hold on
comet(rand(size(x))) ;
KSSV on 8 Mar 2019
as of now to make the plot can run the loop by skipping some need not to run for every point.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!