Changing layers on a bar graph

3 visualizzazioni (ultimi 30 giorni)
Jiaqi Wang
Jiaqi Wang il 1 Ago 2022
Commentato: Jiaqi Wang il 4 Ago 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!

Risposta accettata

Adam Danz
Adam Danz il 1 Ago 2022
Modificato: Adam Danz il 1 Ago 2022
Plot the green bars first, before the bar plot.
Alternatively use uistack to control the stacking order of graphics objects.
  5 Commenti
Adam Danz
Adam Danz il 2 Ago 2022
Modificato: Adam Danz il 4 Ago 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 il 4 Ago 2022
This works perfectly! Thank you so much!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by