ginput on tiled layout in app designer

4 visualizzazioni (ultimi 30 giorni)
LukeJes
LukeJes il 21 Nov 2023
Commentato: Voss il 21 Nov 2023
Hi there,
I'm trying to get ginput to work on a tiled chart layout in matlab's app designer. I tried to follow the advice from the links below, but I keep just getting a separate figure pop up outside of the app. I am using r2020b.
An example exerpt of the code that I have tried to use. app.ax1 corresponds to the top plot, and app.ax2 to the bottom. Both are contained within app.tiledlayout1. Ideally I would like to be able to use ginput on either plot (anywhere within app.tiledlayout1):
plot(app.ax1,app.braMarkerDataFiltered(:,15))
ylabel(app.ax1,'Z','FontWeight',"bold");
title(app.ax1,'STERNUM MARKER',"FontSize",10);
plot(app.ax2,app.braMarkerDataFiltered(:,42))
ylabel(app.ax2,'Z','FontWeight',"bold");
title(app.ax2,'HEEL MARKER',"FontSize",10);
app.tiledlayout1.HandleVisibility = 'on';
ginput;
app.tiledlayout1.HandleVisibility = 'off';
Any help would be much appreciated!

Risposta accettata

Voss
Voss il 21 Nov 2023
Try setting the HandleVisibility of the uifigure (not the tiledlayout), e.g.:
app.UIFigure.HandleVisibility = 'on';
set(0,'CurrentFigure',app.UIFigure); % one of the links has this and one doesn't
ginput;
app.UIFigure.HandleVisibility = 'off';

Più risposte (0)

Categorie

Scopri di più su Develop uifigure-Based Apps in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by