MathGroup Archive 2010

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

Search the Archive

Re: Filling from x_1 to x_2


On 8/22/2010 8:14 AM, Anders wrote:
> Hi,
>
> I'm trying to only fill the area under a function from one x-value
> (x_1) to another x-value (x_2) (the purpose is to represent an
> integral with the filling) . I'm using the Filling ->  Axis option, but
> I'm not sure how to limit the x-values.
>
> Do you guys know anything about this?

I would make one plot with no Filling on a larger domain, and another 
plot with Filling on the interval that you would like filled, then show 
the plots together. For example:

f[x_] = x^3 + x + 5


plot1 = Plot[f[x], {x, -3, 3}];
plot2 = Plot[f[x], {x, 1, 2}, Filling -> 0];
Show[{plot1, plot2}]

Sometimes you might need PlotRange->Automatic within Show, and it's also 
a good idea to include AxesOrigin->{0,0} when you are using Filling->0 
or Filling->Axis.
-- 
Helen Read
University of Vermont


  • Prev by Date: Re: "Abort Evaluation" does not work
  • Next by Date: Verifying an n-point polygon
  • Previous by thread: Re: Filling from x_1 to x_2
  • Next by thread: Input problems