Multiple plots in uiaxes in app designer

28 次查看(过去 30 天)
Hi
I am trying to use multiple UIAxes in in the same UIAxes in app designer. I have a main UIAxes with ticks and labels where I want to plot 16-channel signal. Each channel I want to plot in their own uiaxes, buth without ticks and labels and color. To do so I use this code:
for i = 1:length(app.channel_selected)
app.axes_list(i) = uiaxes(app.RecordingsTab,'Position', app.UIAxes.Position);
set(app.axes_list(i), 'PositionConstraint','innerposition');
set(app.axes_list(i), 'XTick', []);
set(app.axes_list(i), 'YTick', []);
set(app.axes_list(i), 'Color', 'none');
end
But when the signal is plottet, it is plottet outside of the main UIAxes.
How can I alligne these multple UIAxes with the main UIAxes the signals will be shown whithin the main axes? I tried to use 'innerposition', it became better, but still not enough.
Thank you
  5 个评论
Anna Sergeeva
Anna Sergeeva 2022-2-12
Now I add this line in the code
set(app.axes_list(i), 'InnerPosition', app.UIAxes.InnerPosition);
And it works now :-)
Thank you for helping me to reach there.

请先登录,再进行评论。

回答(2 个)

Cris LaPierre
Cris LaPierre 2022-2-12
I would try using a different approach. Have you looked into stackedplot?

MEP
MEP 2022-5-3
I have the same problem Matlab R2020b. The documentation is here but doesn't work. I have used: app.UIAxes2.PositionConstraint = 'innerposition' for my code but the result doesn't work :(
  2 个评论
Anna Sergeeva
Anna Sergeeva 2022-5-3
Try this
set(app.UIAxes2, 'InnerPosition', app.UIAxes1.InnerPosition);
It helped me :-)
Best
Anna

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by