How to fill light blue above the dotted line and slightly darker colour below dotted line in whole figure.

 採用された回答

VBBV
VBBV 2021 年 2 月 3 日
編集済み: VBBV 2021 年 2 月 3 日

0 投票

clear
clc
x = 0:30;
y = ones(1,length(x))*202
ylim(([0 1600]))
plot(x,y,'b--','linewidth',4)
xx = [0 30 30 0];
yy = [0 0 200 200];
xx2 = [0 30 30 0];
yy2 = [203 203 1600 1600];
patch(xx,yy,'blue','EdgeColor','none','FaceAlpha',0.5);
hold on
patch(xx2,yy2,'red','EdgeColor','none','FaceAlpha',0.5);
Try with different coordinates and colors

1 件のコメント

VBBV
VBBV 2021 年 2 月 3 日
Refer patch for filling

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2021 年 2 月 3 日

編集済み:

2021 年 2 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by