How to respond to update of axis data?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Eric Delgado
le 6 Oct 2022
Modifié(e) : Eric Delgado
le 6 Oct 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!"
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!