How to add different shaded Color to the back ground of a graph?
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
taimour sadiq
am 15 Aug. 2023
Kommentiert: taimour sadiq
am 16 Aug. 2023
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1457782/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1457787/image.png)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!