UIAxes - Remove Brushed Data through button click Callback.

9 Ansichten (letzte 30 Tage)
Jordan
Jordan am 4 Sep. 2023
Beantwortet: Mario Malic am 6 Sep. 2023
I have an app in app designer that containes a UIAxes in 2023a.
I currently enable the brush data function though a button click to allow user selection. Is it possible to use the "Remove Data" or "Replace with NANs" functionality that is normally accessed via a right click on the selected data, through a button click callback?
I'm unsure how to access the functionality in the code.
Thanks
  8 Kommentare
Mario Malic
Mario Malic am 6 Sep. 2023
Or you want to remove the brushed data without using the context menu, but using a button or something else?
Jordan
Jordan am 6 Sep. 2023
Hi Mario, more the latter here. So I want to remove brushed data without using the context menu, but using a button instead. More just to improve user experience than anything.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Mario Malic
Mario Malic am 6 Sep. 2023
Here is an example of setting brushed data to NaNs, now you have to incorporate this in the callback.
fig = uifigure();
ax = uiaxes(fig);
t = 0:0.1:1;
y = sin(2*pi*t);
h = plot(ax, t, y, '-r');
hold (ax, "on");
h2 = plot(ax, t, 2*y, '-g');
% Uncomment after brushing data
% idx = logical(h.BrushData)
% h.YData(idx) = nan;
% h2.YData(idx) = nan;

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by