COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Plot and advanced filling

• Email
• Follow

```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?

```
 0
Reply Benjamin 4/9/2010 7:35:30 AM

See related articles to this posting

```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}]

--
University of Vermont

```
 0
Reply Helen 4/10/2010 10:51:58 AM

```x[t_] = t;

y[t_] = -t + 1;

Plot[{x[t], y[t], Min[x[t], y[t]]},
{t, 0, 1},
Filling -> {3 -> Axis}]

Bob Hanlon

---- Benjamin Hell <hell@exoneon.de> 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?

```
 0
Reply Bob 4/10/2010 10:55:05 AM

2 Replies
439 Views

Similar Articles

12/6/2013 9:00:08 PM
page loaded in 69514 ms. (0)