How fill color for base load, peak load, intermediate load?
Show older comments
My data is with x axis date time, and y axis power in watt. They are data points.
I want to fill color for base load, peak load, intermediate load. Base load area should be from y=0 to y=3, and intermediate load is from y=3 to y=9, peak load is from y=9 to upper y value. I have tried the code below. But the green part is wrong. green part should be on the left and below blue part.
figure(1);
plot(myDatetime,PSummesplit,'b')
hold on;
le1=3.12;
le2=9;
area(myDatetime,max(PSummesplit, le1),le1,'EdgeColor','none','FaceColor',[0 0.25 0.25])
area(myDatetime,max(PSummesplit, le2),le2,'EdgeColor','none','FaceColor',[0 0.25 0.5])

How should I fix this? Can anyone help me out please? Thank you for your time!
1 Comment
Jyotsna Talluri
on 17 Jul 2019
Hi,
The code you implemented looks correct.It depends on the data of our plot.Can you provide the dataset (myDateTime,,PSummesplit)so that I can verify
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!