How do I undo brush data removal in R2019a?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 10 de Jun. de 2019
Respondida: MathWorks Support Team
el 18 de Jun. de 2019
I am using the brushing tool to select a set of points on my plot, and then remove all of the unbrushed points (with right-click > "Remove Unbrushed").
After removing these points, I want to later revert to the state of the original graph. Is there a way to undo all of the data removals from the brush tool (such as "brush undo" or "brush reset")?
Respuesta aceptada
MathWorks Support Team
el 19 de Jun. de 2019
There is not a builtin function specifically to undo data removal from brushing. However, one of the following workarounds may work for you:
1. The simplest way to reset your graph would be to click the general 'undo' button for the figure (under 'Edit'). If you backtrack to when you removed the unbrushed points, you can restore the original graph.
2. You could write your own 'brush undo' function to restore the original graph.
When you delete data with the brush tool, the associated 'YData' of the plot is changed to NaN values. Thus, the data cannot be automatically restored without using the general 'undo' button. However, you could work around this by writing a function which resets the 'YData' to the original graph data. For example:
function undoBrush(h, data)
% h is a handle to the line containing the deleted data
% data is the original y data used to make the plot
h.YData = data;
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects 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!