How to delete a plot in UIAxes?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Eduardo Gaona Peña
el 2 de Oct. de 2017
Comentada: David J. Mack
el 7 de Feb. de 2018
I'm using a button as a tool to plot one linear fit over a curve and I would like to replace the plot of the fit whenever I push the button again. I'm not quite sure how to use the delete command in this case. Any help is appreciated :)
0 comentarios
Respuesta aceptada
David J. Mack
el 3 de Oct. de 2017
Editada: David J. Mack
el 3 de Oct. de 2017
You could store the handle to the fitted line in the UserData of the figure and then retrieve it every time the button is hit and use it to replace the YData of the line with the new fitted YData (this "replaces" the old line). Greetings, David
2 comentarios
David J. Mack
el 7 de Feb. de 2018
hFig = figure(); hPlot = plot(cfit); hFig.UserData.hPlot = hPlot; % Code to add the button
% in your callback hFig.UserData.hPlot.YData = newYData;
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!