How to clear data from plot in Matlab GUI
111 次查看(过去 30 天)
显示 更早的评论
I try clc, clf and nothing works any useful tips?
0 个评论
采纳的回答
Image Analyst
2013-8-14
编辑:Image Analyst
2013-8-14
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 个评论
更多回答(2 个)
Azzi Abdelmalek
2013-8-14
You can use cla
5 个评论
Image Analyst
2016-10-18
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.
David Sanchez
2013-8-14
Try with
clf(handles.my_axis_handle)
where my_axis_handle is the handle of the axis on your GUI.
2 个评论
Robert
2016-4-9
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?
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!