MathGroup Archive 2004

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

Search the Archive

RE: shade area between vertical lines

  • To: mathgroup at
  • Subject: [mg46913] RE: [mg46907] shade area between vertical lines
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Tue, 16 Mar 2004 02:37:14 -0500 (EST)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: elmanthira [mailto:my_name at]
To: mathgroup at
>Sent: Monday, March 15, 2004 5:54 AM
>To: mathgroup at
>Subject: [mg46913] [mg46907] shade area between vertical lines
>I know that it is possible to have Mathematica generate a plot that 
>shows the area shaded in between the lines y=1 and y=2 with 
>something like:
>FilledPlot[{1, 2}, {x, -1, 5}, PlotRange -> {-1, 5}]
>This makes a lovely display of the open set in R^2 {(x,y):1<y<2}.
>I wish to intersect this with the set in R^2 {(x,y):1<x<2}.
>First, how can I make it graph the four lines on the same plot, AND 
>shade in rectangle formed by the overlapping bars.
>Ideally, I'd want the bars to be shaded in with the rectangle 
>formed to 
>have some sort of crosshatch pattern, or other "darker" area.  
>It seems 
>that Mathematica automatically does some color differentiation for 
>different regions, and that would be adequate, I hope.
>I'm using Mathematica 5 (for the classroom, if that matters), on WinXP 
>Pro.  I'm not a very sophisticated mathematica user, but since it's 
>spring break, I thought I'd start writing down some of my notes.
>Thanks much.

Perhaps you like to try this:

<< Graphics`FilledPlot`

Plot[{x^2}, {x, -1, 5}, PlotRange -> {{-1, 5}, {-1, 5}}, 
  GridLines -> {{1., 2.}, {1, 4}}, 
  Prolog -> {{Hue[1/2, .3, 1], Rectangle[{1., -1.}, {2., 5.}], 
        Hue[1/2, .3, 1], Rectangle[{-1., 1.}, {5., 4.}], Hue[1/2], 
        Rectangle[{1., 1.}, {2., 4.}]}}, DisplayFunction -> Identity]

Show[%, AxesFront -> True, DisplayFunction -> $DisplayFunction]

Hartmut Wolf

  • Prev by Date: Typesetting: ?Big Sigmas and Little Sigmas?
  • Next by Date: Re: shade area between vertical lines
  • Previous by thread: shade area between vertical lines
  • Next by thread: Re: shade area between vertical lines