Multiple plots in uiaxes in app designer

4 vues (au cours des 30 derniers jours)
Anna Sergeeva
Anna Sergeeva le 12 Fév 2022
Commenté : MEP le 4 Mai 2022
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 commentaires
Anna Sergeeva
Anna Sergeeva le 12 Fév 2022
I tryied that. It did not help :-(
Anna Sergeeva
Anna Sergeeva le 12 Fév 2022
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.

Connectez-vous pour commenter.

Réponses (2)

Cris LaPierre
Cris LaPierre le 12 Fév 2022
I would try using a different approach. Have you looked into stackedplot?
  1 commentaire
Anna Sergeeva
Anna Sergeeva le 12 Fév 2022
Thank you for your answer. I will take a look.

Connectez-vous pour commenter.


MEP
MEP le 3 Mai 2022
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 commentaires
Anna Sergeeva
Anna Sergeeva le 3 Mai 2022
Try this
set(app.UIAxes2, 'InnerPosition', app.UIAxes1.InnerPosition);
It helped me :-)
Best
Anna
MEP
MEP le 4 Mai 2022
Many thanks Anna! Now it works! :)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Measurements and Spatial Audio dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by