how to find brushed data

41 ビュー (過去 30 日間)
eric jackson
eric jackson 2021 年 10 月 13 日
コメント済み: eric jackson 2021 年 10 月 15 日
I want to create a figure, plot some data, manually brush some of that data and then run some analysis on the selected data. In Matlab 2010b I created one subroutine which created several figures, each with plot:
h=figure;
scatter(xdat(ii),ydat(ii));
brush(h,'on');
In the 2nd subroutine I found the brushed data:
b0=findobj('-property','BrushData');
xx=get(b0,'XData')
yy=get(b0,'YData');
Ths no longer works in Matlab 2021. b0 comes back empty. How do I find the Brushed data?
  1 件のコメント
eric jackson
eric jackson 2021 年 10 月 15 日
Thanks for your help.

サインインしてコメントする。

採用された回答

Yair Altman
Yair Altman 2021 年 10 月 15 日
In the new graphics system (R2014b onward), the brushed data info can be extracted from the hidden/undocumented BrushHandles property, as exaplained here: https://undocumentedmatlab.com/articles/hidden-hg2-plot-functionality
As Dave noted above, it's a bit dangerous to rely on undocumented properties/features, but note that this particular feature (like the vast majority of other undocumented features in Matlab) has not changed since R2014b. So while it might indeed stop working in the next release, history has shown that this is in fact unlikely. As long as you're aware of the limitations/risks, you can use these features to your advantage.
  2 件のコメント
eric jackson
eric jackson 2021 年 10 月 15 日
h.BrushData comes back empty.
eric jackson
eric jackson 2021 年 10 月 15 日
My mistake this time. I found it. Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by