How do I highlight a certain area between two lines?
古いコメントを表示
I'm trying to graph measured CO2 levels compared to the safe range according to the WHO.
But when I use the patch command, but that highlights the ENTIRE area, and not the the area that crosses the high concentration.


4 件のコメント
KSSV
2022 年 12 月 22 日
You need to pick the coordinates wisely to hightlight the region you want.
Ben van Zon
2022 年 12 月 22 日
KSSV
2022 年 12 月 22 日
Attach your data and show us what region you want to highlight.
Ben van Zon
2022 年 12 月 22 日
採用された回答
その他の回答 (2 件)
% Generate some data
t = 0:.1:10;
y = sin(t);
plot(t, y);
hold on
% highlight a portion of data
idx = t>6 & t<9;
area(t(idx), y(idx))
Image Analyst
2022 年 12 月 22 日
0 投票
This is a FAQ, so see the FAQ:
カテゴリ
ヘルプ センター および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


