フィルターのクリア

How to respond to update of axis data?

5 ビュー (過去 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 Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by