# Problem With Filling

I am plotting the graph of the logistic equation in a manipulate. My borders range from {x, 0, 100}, {y, 0, 100}. I would like to fill the background of the plot with a light grey color, almost completely transparent, over a range from {x, 0, 20}, {Y, 0, 100}. How might I go about doing this?

If you just want to fill the background of the plot and don't need to fill under the curve, I would use Prolog and Rectangle.

Plot[
x,
{x, 0, 100},
PlotRange -> {{0, 100}, {0, 100}},
Prolog -> {
GrayLevel[0.95],
Rectangle[{0, 0}, {20, 100}]
}
]


• Sounds like what I'm looking for. Where do I locate the code in a manipulate? – HenryB Mar 23 at 20:06
• Without knowing how you're plotting your equation, it's difficult to say. If you're using Plot, ListPlot, ParametricPlot, or some other version, you can do it the way I show. If you're using a Graphics environment, then you can simply include the GrayLevel and Rectangle commands in the list of graphics to create. If you include either a minimal working example, or at least more details, it'll be easier for you to get help. – MassDefect Mar 23 at 22:25
• I was able to get your code working in a Plot. Unfortunately, when I tried to combine the Plot with other data sets using the function 'Show' your shaded area disappeared. – HenryB Mar 24 at 14:22
• If you're using Show, any options should either go into the first thing that you're showing, or else go as options to Show itself. Show only looks at the first thing and takes its options, unless its given options directly. So Show[Plot[x, {x, 0, 100}, Prolog->{stuff}], Plot[otherfunction...]] should work, or you can do Show[Plot[x, {x, 0, 100}], Plot[...], Prolog->{GrayLevel[0.99], Rectangle[...]}]. – MassDefect Mar 24 at 18:33
• Thanks for your help. Everything's working, but I have one more request. How do I change the color of the background rectangle to say, light blue? – HenryB Mar 25 at 18:41