Cannot select data in UIAxes app with brush button.
Show older comments
I am designing an app in Matlab R2020a and having serious issues using the data brushing feature for a scatter plot. Here is a basic layout of what my app looks like:
https://imgur.com/HIbsYUZ
My goal is that a user can load a data file, brush out any data they do not want, and save the file.
Here is my issue:
https://imgur.com/smFTQ7P
As you can see the data brushing box I've drawn doesn't highlight the data. I’m using the Brush Data button at the top right of the figure to do this. What's odd is it will highlight if I draw in a random area that doesn't have any data.
https://imgur.com/HfVEghY
If I open a figure and plot to a figure I can select data with the brush without issue.
https://imgur.com/C8XXF5H
I don't want to have to do this though. I want the UIAxes to work in the app the way I've designed it. How do I fix this?
4 Comments
Cameron
on 22 Feb 2023
Can you post your .mlapp file here? It's hard to diagnose what's going on without trying it ourselves.
John H.
on 18 Apr 2023
First of all, perhaps something to bring up with managment.
I find app designer to be generally intuitive, more so than guide in many instances.
I cant for the life of me fathom why they would leave the brush feature so incredebly broken in appdesigner, and for so long.
Looking thru the MATLAB answers, it seems people have been asking the same questions in different ways in relation to brush since app designers debut.
I am using 2022a.
first of all,
you seemingly cannot add brush to the UIaxes toolbar
calling
axtoolbar(app.UIAxes,{'brush'});
for example, will not add a brush icon/functionaltiy.
however we can effectivly we gain the brush functionality by creating a button with ...
b = brush(app.UIAxes);
b.Enable = 'on';
and the plot will allow us to draw the brush window.
But nothing stays,
We see the red box, but nothing will highlight.
Cant figure out how to access any of the brushed data,
Not even sure if brushed data exists.
Please if you have any workarounds or fixes, it would be immensly helpful.
Cameron
on 18 Apr 2023
Instead of
line(app.UIAxes, 'XData',X,'YData',Y)
use
plot(app.UIAxes,X,Y)
You can't brush data from a primative line in R2022a.
Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!