clear all axes handles in GUI

8 visualizaciones (últimos 30 días)
Christof
Christof el 29 de Jun. de 2011
Comentada: Ayesha Abbasi el 17 de Jul. de 2018
I have a GUI that plots 4 axes in a GUI and I would like to clear those with a button. Tried cla(findall(0,'type','axes')) but it does not do anything. what is wrong with this command?

Respuesta aceptada

Paulo Silva
Paulo Silva el 29 de Jun. de 2011
arrayfun(@cla,findall(0,'type','axes'))

Más respuestas (3)

Gerd
Gerd el 29 de Jun. de 2011
Hi Christof,
I think your code should work. Please make sure you are using the right figure handle.
Gerd
  3 comentarios
Gerd
Gerd el 29 de Jun. de 2011
cla clears all the children from an axes. And I assume this is what he is talking about, because nothing is happining. You can even use just cla and it should work for one single axes with multiple plots on. If he has the wrong current figure nothing will happen.
Paulo Silva
Paulo Silva el 29 de Jun. de 2011
Gerd please read the question again, Christof got 4 axes and he wants to clear them all, his code finds all the axes objects but fails because cla just clears the first axes returned by findall.

Iniciar sesión para comentar.


Christof
Christof el 29 de Jun. de 2011
thanks for your help

norfaizayu
norfaizayu el 30 de En. de 2012
when i use that source code, the picture in axes clear but the axes still there.how can i clear all that thing?picture in axes and axes all so that's mean will back to normal stage.

Categorías

Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by