MathGroup Archive 2010

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

Search the Archive

Re: Plot and advanced filling

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109003] Re: Plot and advanced filling
  • From: Helen Read <hpr at together.net>
  • Date: Sat, 10 Apr 2010 06:52:03 -0400 (EDT)
  • References: <hpmlc2$9us$1@smc.vnet.net>
  • Reply-to: read at cems.uvm.edu

On 4/9/2010 3:35 AM, Benjamin Hell wrote:
> Hi,
> I have a plot with two curves in it. Let's make things simple and say
> the first one is x[t]:=t and the second one y[t]:=-t+1. Plotting shall
> be done on the interval [0,1].
> So far so good. Now I want to fill in the area in which t<  x[t] and t<
> y[t]. If I use Filling->Axis, of course the area below the whole plot of
> x[t] and y[t] is filled. The overlapping part is filled in a less
> transparent color, but that's not what I want. Is there any elegant way
> to achieve what I want to do?
>
> Thanks in advance.
>

I don't think you mean t < x[t] and t < y[t].
This would mean t < t and
t < -t + 1
The first inequality is always false, so the region you describe is empty.

Do you actually mean to fill the region where y < x and y < -x+1?

If that is what you are after, use RegionPlot.

f[x_]=x
g[x_]=-x+1

RegionPlot[{y < f[x] && y < g[x]}, {x, 0, 1}, {y, 0, 1}]

--
Helen Read
University of Vermont




  • Prev by Date: Re: List Manipulation: Conditionally changing y value
  • Next by Date: Re: evaluate the floor s to yield a number
  • Previous by thread: Re: Plot and advanced filling
  • Next by thread: Using numbers close to to zero in Mathematica version 6