How can I move legend in app designer?
4 ビュー (過去 30 日間)
In GUI (figure), you know that I can keep left mouse and move legend.
p = uipanel('Position',[.1 .1 .8 .8]);
hSub = subplot(1,1,1, 'Parent', p);
But in app designer, I can't.
Do anyone know why. Please tell to me how to fix.
回答 (2 件)
Adam Danz 2022 年 9 月 27 日
The legend isn't draggable in your release (R2019b) but it is draggable starting in R2021a.
Eric Delgado 2022 年 9 月 22 日
Hi @galaxy, just create a handle for your legend. See code attached made on R2021b (if you are working on a different release of Matlab, you have to open App Designer and save the file before run it).
% Option 1: create a handle to the legend (declare it as property of your app previously)
app.h = legend(app.UIAxes, 'sint t');
% Option 2: search it when you need it
h = findall(app.UIFigure, 'Type', 'Legend')