Borrar filtros
Borrar filtros

Changing layers on a bar graph

4 visualizaciones (últimos 30 días)
Jiaqi Wang
Jiaqi Wang el 1 de Ag. de 2022
Comentada: Jiaqi Wang el 4 de Ag. de 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!

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by