Azzera filtri
Azzera filtri

How to clear Panel of contents (Axes)

22 visualizzazioni (ultimi 30 giorni)
Jordan
Jordan il 17 Ott 2023
Modificato: Jordan il 17 Ott 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?

Risposta accettata

dpb
dpb il 17 Ott 2023
Spostato: dpb il 17 Ott 2023
delete the objects desired using their handles

Più risposte (0)

Categorie

Scopri di più su Language Fundamentals in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by