MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Filling question


Gabriel Landi wrote:

> Here is a silly question: How to fill the region between two overlapping 
> curves? e.g., the region near x=4 in
>
> Plot[{Exp[-(x - 3)^2], Exp[-(x - 5)^2]}, {x, 0, 10}
>
> Thanks in advance,
>
> Gabriel Landi
>

You may use a RegionPlot:

f[x_] = Exp[-(x - 3)^2]; 
g[x_] = Exp[-(x - 5)^2];
{xs, ys} = {x, f[x]} /. First@Solve[f[x] == g[x], x] // Quiet
region = y <= f[x] && x >= xs || y <= g[x] && x <= xs ;
Show[Plot[{f[x], g[x]}, {x, 0, 10}],
 RegionPlot[region, {x, 0, 10}, {y, 0, 10}]]

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de



  • Prev by Date: Re: Filling question
  • Next by Date: VectorColorFunction
  • Previous by thread: Re: Filling question
  • Next by thread: Re: Filling question