How to respond to update of axis data?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
bethel o
el 6 de Oct. de 2022
Comentada: bethel o
el 7 de Oct. de 2022
I need to set a callback for when data in axis is updated. Is there a way to do this? i.e is their a way to be notified when a figure/axis/line data changes.
Thanks
0 comentarios
Respuesta aceptada
Eric Delgado
el 6 de Oct. de 2022
Editada: Eric Delgado
el 6 de Oct. de 2022
fig = figure;
ax1 = axes(fig);
h = plot(ax1, randn(1001,1));
addlistener(h, 'YData', 'PostSet', @(~,~)disp("YData changed!"));
% Changing data...
h.YData(1) = 2*h.YData(1);
% Answer:
% "YData changed!"
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Object Properties 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!