Extract brushed data programmatically
显示 更早的评论
Hi everyone smarter than me, (Upfront--> Can I get some Matlab Engineer/Guru eyes on this ?)
I'm looking to extract exactly WHICH data points have been brushed by the user in a scatter plot.
Clearly this is tracked somewhere, because if you right click the plot you can
- Export the brushed data to a variable
- Delete brushed/unbrushed points
- Copy to the command line

How can I get that list of brushed data programmatically?
My ultimate goal is to brush a linked set of scatter plots, but but a first step is to just select a collection of points, and get a logical selection out again.
I'd like to hook into the pre-built work Matlab engineers have done, rather than home brew a janky and slow version.
Does anyone know where Matlab keeps this secret sauce?
------------------------------
Here's what I've tried so far
My best guess starting point is using the struct() function to display hidden internal properties of the brush object.
However, despite the new field "ModeHandle", I can't find what I'm after once I've done that.
-------------------------
Example of my flow:
% make a scatter plot
x = 0.1:0.1:100;
y = sin(x)./x;
scatter(x,y);
b = brush; % make the brush object
b.Enable = 'on' % enable brushing
Off I go to brush (see photo above)
Now expose the hidden brush object
b2 = struct(b); % Make brush object show all hidden properties
ModeHandle field appears, but I can't seem to find where the brushed points/ properies are.

I've delved deep into ModeHandle, with no luck.
Any help navigating the ModeHandle field would be appreciated.
2 个评论
Allen
2023-5-18
I am also including the link he proivded to his Undocumented Matlab webpage.
Scott Smith
2023-5-18
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!