How to remove rectangle from plot after updating

3 visualizaciones (últimos 30 días)
Jason Hawkins
Jason Hawkins el 4 de Oct. de 2015
Comentada: KSSV el 5 de Sept. de 2018
I am plotting a series of randomly placed rectangle objects. Rectangles are not allowed to overlap. I have a method for removing rectangles when they overlap another rectangle, but the removed rectangle object is still plotted. How can I tell Matlab to only plot the final set of rectangles?
I can remove the object from the class I created, but it still appears in the plot.
  2 comentarios
Jason Hawkins
Jason Hawkins el 4 de Oct. de 2015
Editada: mizuki el 5 de Sept. de 2018
I believe I have it working now. I needed to refer to the rectangle property of the object when I called delete() on it rather than the whole object.
Ex. delete(obj) - does not work
delete(obj.rectangle) - does work
KSSV
KSSV el 5 de Sept. de 2018
You will get exact help on knowing the code.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by