필터 지우기
필터 지우기

How to respond to update of axis data?

조회 수: 1 (최근 30일)
bethel o
bethel o 2022년 10월 6일
댓글: bethel o 2022년 10월 7일
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

채택된 답변

Eric Delgado
Eric Delgado 2022년 10월 6일
편집: Eric Delgado 2022년 10월 6일
Hey @bethel o, yeah, it's possible. "YData" is not a property of figure or axes, ok?
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!"
  댓글 수: 1
bethel o
bethel o 2022년 10월 7일
How do you acquired this kind of Jedi skills?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by