The easiest approach I can come up with is to use two functions Plotin which you can select the range you want to shade, and the other the whole range, using the option Fillingto get the shading. Then you show them together using Show, for example:
distFn = PDF[NormalDistribution[], x];
Show[
{Plot[distFn, {x, -5, 5}],
Plot[distFn, {x, -1, 1}, Filling -> {1 -> {0, Automatic}}]},
PlotRange -> All]
It is still a bit on the clumsy side, but it works, and it's easy enough to abstract into one function if you do.
source
share