clear single plots intead of the whole plot
Mostrar comentarios más antiguos
Hi! I'm doing a plot consisting of a "chart" and some dots coming up on it with 10 sec inteval is it possible to only erase the dots and keep the chart? right now I'm using the clf function but it clears the whole window. Johan
Respuesta aceptada
Más respuestas (2)
Gerd
el 16 de Jun. de 2011
Hi Johan,
on a simple plot you would write
a=linspace(0,10,1000);
b=sin(a);
c=cos(a);
h1 = plot(a,b);
hold
h2=plot(a,c,'r');
to remove the first plot simply
delete(h1);
So if you keep the handle of your dots you can simply remove them
Gerd
Johan
el 16 de Jun. de 2011
0 votos
1 comentario
Arturo Moncada-Torres
el 16 de Jun. de 2011
Our pleasure ;)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!