
In App Designer is it possible to plot lines on top of UI components?
14 ビュー (過去 30 日間)
古いコメントを表示
I'm working on an application that ties to a Simulink model. The intent is to click two check boxes, and then a button that connects them. The connection is made between associated nodes in Simulink, and then a line is plotted on a UIAxes to show the connection. The UIAxes spans the whole app window, and pulls the positions of the checkboxes, which are built into custom UI components.
Essentially, all of this is functional already. My problem is that when the lines are plotted on the UIAxes between two checkbox elements, the lines are drawn behind UI elements within the app. This could be the custom components, or any buttons I have built into the app. Can anyone help with a way to force the UIAxes to draw on top of all other UI components?
I can incorporate some images and code if needed to clarify how the app is set up.
0 件のコメント
採用された回答
Adam Danz
2025 年 6 月 2 日
> In App Designer is it possible to plot lines on top of UI components?
Lines can cross over text layers but other UI components live on a different layer. In this demo, an annotation line crosses under the checkbox, button, and image, but on top of the checkbox label and the ui-label.
fig = uifigure;
cbx = uicheckbox(fig);
uibutton(fig,Position=[190 97 85 30])
uilabel(fig,Position=[285 96 60 30],Text='label')
uiimage(fig,ImageSource=rand(5,6,3),Position=[310 92 80 36])
A = annotation(fig,'line',units='pixels',Position=[1 111, 500 0])

Sharing an image of your app may be helpful to suggest workarounds.
5 件のコメント
Adam Danz
2025 年 6 月 16 日
I suspect that if your design was supported in GUIDE, then it should be supported using uicontrol objects.
This page from the MATLAB documentation shows a conversion table from uicontrol objects to ui components used in App Designer. You'd be converting in the other direction.
I'll share your use case internally.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


