MathGroup Archive 2012

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

Search the Archive

Re: Filling area between curves


f[x_] = -1 + 4 x - x^2;
g[x_] := x - 2;
h[x_] := 2 - x;

Show[
 RegionPlot[
  h[x] < y < f[x] && x < 2 ||
   g[x] < y < f[x] && x > 2,
  {x, 0, 5}, {y, 0, 3}],
 Plot[{f[x], g[x], h[x]}, {x, 0, 5},
  PlotRange -> {0, 3}]]


Bob Hanlon


On Fri, Feb 3, 2012 at 2:11 AM, Elaine Ritter <eyeninei9 at gmail.com> wrote:
> I have 3 curves, and I want to fill one of the areas that they bound.
> The equations are
> F[x] = -1 + 4 x - x^2
> G[x] := x - 2
> H[x] := 2 - x
> and I want to fill the region that I shaded in this picture:
> http://i.imgur.com/X2urH.png
>
> I've been trying to figure this out on my own, but to no avail. How do
> I do this?



  • Prev by Date: Creating an executable with Mathematica
  • Next by Date: Re: Funny Behavior of Module
  • Previous by thread: Filling area between curves
  • Next by thread: Re: Filling area between curves