transparent grey bar on graphs
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi, I would like to draw a grey bar to emphasize when the signals were triggered like in the picture. Should I use patch function as it will be loop.
thanks for suggestion
.
댓글 수: 0
채택된 답변
Cris LaPierre
2022년 9월 1일
편집: Cris LaPierre
2022년 9월 1일
x=0:.1:5;
y=(x-2).^3;
patch([0 5 5 0],[0 0 4 4],[.75 .75 .75])
hold on
plot(y,x,'LineWidth',2)
hold off
If you do prefer to have a transparent bar, then adjust the FaceAlpha property. Just note that this will also cause a slight change in the color of the patch.
x=0:.1:5;
y=(x-2).^3;
plot(y,x,'LineWidth',2)
patch([0 5 5 0],[0 0 4 4],[.75 .75 .75],'FaceAlpha',0.25,'EdgeColor','none')
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!