ginput on tiled layout in app designer

7 次查看(过去 30 天)
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!

采纳的回答

Voss
Voss 2023-11-21
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';

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by