How can I select programmatically AxesToolbar tool?

I'm building an app and would like to use only brush tool for one of my plots and pre-select this for user. How can I select at startup function the brush tool programmatically?
So far I have made brush the only availabe option:
% Create axestoolbar with only brush
axtoolbar(app.UIAxes,{'brush'});

Answers (1)

Just doing this after your scatter should work:
x = rand(20,1);
y = rand(20,1);
scatter(x,y)
brush('on')

Categories

Find more on App Building in Help Center and File Exchange

Products

Release

R2021a

Asked:

on 10 Aug 2021

Answered:

on 11 Aug 2021

Community Treasure Hunt

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

Start Hunting!