Filter löschen
Filter löschen

How to clear data from plot in Matlab GUI

313 Ansichten (letzte 30 Tage)
Jonasz
Jonasz am 14 Aug. 2013
Kommentiert: Yassir Amhot am 4 Dez. 2020
I try clc, clf and nothing works any useful tips?

Akzeptierte Antwort

Image Analyst
Image Analyst am 14 Aug. 2013
Bearbeitet: Image Analyst am 14 Aug. 2013
Perhaps try this:
axes(handles.averSpec); % Make averSpec the current axes.
cla reset; % Do a complete and total reset of the axes.
If you want to clear just the curve, bars, surfaces, or whatever you plotted, and not the labels, tick spacing etc., then get the handle to it when you created it and then delete it
hPlotData = plot(....... whatever
% Now get rid of it.
delete(hPlotData);
  7 Kommentare
Hunter Pruett
Hunter Pruett am 23 Mai 2020
awesome, thanks so much!
Yassir Amhot
Yassir Amhot am 4 Dez. 2020
Holy crap, thank you sooo much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 14 Aug. 2013
You can use cla
  5 Kommentare
Martin Castillo Yañez
Martin Castillo Yañez am 17 Okt. 2016
same issue
Image Analyst
Image Analyst am 18 Okt. 2016
If you tried my answer of using
cla reset;
and that did not wipe the axes totally clean, down to a white rectangle with axes in the 0-1 range, then call the Mathworks because your cla function is corrupted. Or you've overwritten it with your own function called cla.

Melden Sie sich an, um zu kommentieren.


David Sanchez
David Sanchez am 14 Aug. 2013
Try with
clf(handles.my_axis_handle)
where my_axis_handle is the handle of the axis on your GUI.
  2 Kommentare
Jonasz
Jonasz am 14 Aug. 2013
It clear all the figure except my axis I want to clear. But i want to clear the data not the whole axis.
Robert
Robert am 9 Apr. 2016
This is exactly what happened to me. When i used this line it cleared everything except what i wanted it to clear. When i type in the handle of the axes i want to clear that is the only one it left alone and cleared the rest of the guy. Any ideas?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Objects finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by