Changing layers on a bar graph

3 vues (au cours des 30 derniers jours)
Jiaqi Wang
Jiaqi Wang le 1 Août 2022
Commenté : Jiaqi Wang le 4 Août 2022
I am making a plot like this:
I want to move the green rectangles behind the two bars. Is there any ways to achieve that other than simply chanign the transparency?
Thanks for everyone who answers my question!

Réponse acceptée

Adam Danz
Adam Danz le 1 Août 2022
Modifié(e) : Adam Danz le 1 Août 2022
Plot the green bars first, before the bar plot.
Alternatively use uistack to control the stacking order of graphics objects.
  5 commentaires
Adam Danz
Adam Danz le 2 Août 2022
Modifié(e) : Adam Danz le 4 Août 2022
Demo:
figure
bar(1:3)
hold on
h = plot([0,4],[.5 .5],'k-','LineWidth', 5);
figure
bar(1:3)
hold on
h = plot([0,4],[.5 .5],'k-','LineWidth', 5);
uistack(h,'bottom')
Jiaqi Wang
Jiaqi Wang le 4 Août 2022
This works perfectly! Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by