Make background of half plot red
Show older comments
I have the following plot

I want the plot background over the yellow line to have a color, e.g. red, to show that this is the "bad" region.
Thanks for any suggestions!
Answers (1)
Star Strider
on 26 Aug 2019
Try this:
figure
plot(rand(3)*0.3, rand(3)*0.3, 'x') % Plot Points
hold on
plot([0 5], [0 5], 'Color',[0.8 0.5 0.1]) % Plot Line
patch([0 5 5 0], [0 5 5 5], 'r', 'FaceAlpha',0.25, 'EdgeColor','none') % Plot Region Above Line
hold off
Experiment to get the result you want.

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!