Changing layers on a bar graph

조회 수: 3 (최근 30일)
Jiaqi Wang
Jiaqi Wang 2022년 8월 1일
댓글: Jiaqi Wang 2022년 8월 4일
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!

채택된 답변

Adam Danz
Adam Danz 2022년 8월 1일
편집: Adam Danz 2022년 8월 1일
Plot the green bars first, before the bar plot.
Alternatively use uistack to control the stacking order of graphics objects.
  댓글 수: 5
Adam Danz
Adam Danz 2022년 8월 2일
편집: Adam Danz 2022년 8월 4일
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 2022년 8월 4일
This works perfectly! Thank you so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by