How to clear Panel of contents (Axes)

9 visualizaciones (últimos 30 días)
Jordan
Jordan el 17 de Oct. de 2023
Editada: Jordan el 17 de Oct. de 2023
Apologies in advance, a lot of words for a fairly basic question;
TL;DR - How can I clear the contents of the Panel, so that when I re-run the plotting function, the old set of axes are deleted and replaced with the new set?
I'm using app designer to build a GUI that allows users to import data, select variables and plot them onto a chart. I'm using PlotNy to allow for multiple Y axis labels/values, as this is not native to Matlab. PlotNy generates a figure with multiple overlapping axes (one per variable), and offsets the Yaxis labels/values to fit.
The problem I have is that when I re-run the function that plots the data, a new set of axes appear on top of and offset from the original axes. This is expected behaviour as I have not cleared or deleted the contents of the Panel. I have tried to CLA the Panel, its Children and even the axes directly, however none of these approaches have worked.
How can I clear the contents of the Panel, so that when I re-run the plotting function, the old set of axes are deleted and replaced with the new set?

Respuesta aceptada

dpb
dpb el 17 de Oct. de 2023
Movida: dpb el 17 de Oct. de 2023
delete the objects desired using their handles

Más respuestas (0)

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by