MathGroup Archive 2008

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

Search the Archive

RE: Re: Small question about Filling between two functions in a determined interval

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94334] RE: [mg94285] Re: Small question about Filling between two functions in a determined interval
  • From: "David Park" <djmpark at comcast.net>
  • Date: Wed, 10 Dec 2008 04:50:57 -0500 (EST)
  • References: <ae0a817a0812090125u1b44a514v20082610b3a9d0a5@mail.gmail.com> <1565898.1228883292754.JavaMail.root@m02>

Needs["Presentations`Master`"]

u[x_] := 48 x
k[x_] := 2 x^3 - 18 x^2 + 60 x + 32
g[x_] = k[x] - u[x];

KillPurple = False;
Draw2D[
 {Draw[{k[x], u[x], g[x]}, {x, -2, 2}],
  Draw[{k[x], u[x], g[x]}, {x, 2, 8},
   Filling -> {1 -> {2}, 3 -> Axis}],
  Draw[{k[x], u[x], g[x]}, {x, 8, 10}]},
 AspectRatio -> 1/GoldenRatio,
 Frame -> True,
 Axes -> {True, False}]


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Felipe Mannshardt [mailto:vexie.infamous at googlemail.com] 


Forgot to add another thing,

if i add,

g[x], which is, g(x) = k(x) - u(x)

g[x_]:=32+12 x-18 x^2+2 x^3

And also add it to the graph,

Plot[{k[x],u[x],g[x]},{x,-2,10},Filling->{1->{2}}]

Now, tell Mathematica to:

Fill the area between k(x) and u(x) in the interval 2->8 (x Axis)
AND
Fill the area between g(x) and x-Axis in the same interval 2->8 (x Axis)

Would this be possible in the same Plot ? (in one graph only) ?

Thanks !

On Tue, Dec 9, 2008 at 10:25 AM, Felipe Mannshardt <
vexie.infamous at googlemail.com> wrote:

> Hello,
>
> i have been trying to get this working, without much success.
>
> What i want, is to fill an area between two functions, but only between
the
> interval from x=2 to x=8
>
> I have,
>
> u[x_]:=48x
> k[x_]:=2x^3-18x^2+60x+32
>
> Plot[{k[x], u[x]}, {x, -2, 10}, Filling -> {1 -> {2}}]
>
> It draws (fills) every area between k(x) and u(x).
>
> How can i tell Mathematica to just fill between a determined interval (x
> Axis : 2->8 ) ?
>
> Thanks !
>
> PS: Between, what is the most used way of pasting text from Mathematica in
> here  ? (Plain Text ? LATEX ? ??? )
>
>
> Thanks !!!
>
>
>
>





  • Prev by Date: GraphicsGrid spacing
  • Next by Date: Re: Plotting a large dataset
  • Previous by thread: Re: Small question about Filling between two functions in a determined interval
  • Next by thread: Re: Small question about Filling between two functions in a determined interval