フィルターのクリア

transparent grey bar on graphs

11 ビュー (過去 30 日間)
HYZ
HYZ 2022 年 9 月 1 日
編集済み: Cris LaPierre 2022 年 9 月 1 日
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
.

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 9 月 1 日
編集済み: Cris LaPierre 2022 年 9 月 1 日
Use patch, and plot the line after the patch.
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 件)

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by