How to add different shaded Color to the back ground of a graph?

30 次查看(过去 30 天)
a = 0:0.1:2*pi;
b = sin(a);
plot(a,b)
i have written a simple code of sin wave.. i want to add diffrent background colours to different regions or bands.. for example 0-2 some colour, 2-4 some other colour.. as shown in a picture added with this question.
i have tried "area" & "Fill" function but not getting desired results.

采纳的回答

Image Analyst
Image Analyst 2023-8-15
Try fill or patch

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Polygons 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by