How to put in color a certain part of the background in a plot with matlab?
Show older comments
Hello,
I would like to draw in grey color a certain part of the background in a plot. I know how to change the background color of the whole plot.I used this code after the plot function:
HANDLE = gca
get( HANDLE );
set( HANDLE, 'Color', [0.7,0.7,0.7] )
Exemple: y=x^2
How can I do to draw the blue part in grey and to leave the other parts in white?

Accepted Answer
More Answers (1)
Jérôme
on 18 Aug 2022
0 votes
In case you are using a legend on your plot, what is plotted with fill will be listed in the legend, whereas what is plotted with rectangle will not be listed in the legend. So, the best one to use depends on what we want to do.
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!