Re: FilledPlot Question
- To: mathgroup at smc.vnet.net
- Subject: [mg39063] Re: FilledPlot Question
- From: "Borut L" <gollum at email.si>
- Date: Sun, 26 Jan 2003 05:24:01 -0500 (EST)
- References: <b0tetq$9hu$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, a possibility is to combine ordinary plot curve with the filled one,
like this:
FilledRange[fun_,{x_,x1_,x2_},{f1_,f2_}]:=
Module[{p1,p2},
Block[{$DisplayFunction=Identity},
p1=Plot[fun,{x,x1,x2}];
p2=FilledPlot[fun,{x,f1,f2}];
];
Show[p1,p2]
]
Your example is
FilledRange[x^2,{x,0,5},{2,4}]
And my example is
FilledRange[Cos[x] Exp[-.1 x],{x,0,20},{4,14}]
That helps?
Borut
"Matthew Senn" <msenn77 at yahoo.com> wrote in message
news:b0tetq$9hu$1 at smc.vnet.net...
> i'm relatively new using mathematica 4.2. the other day, i came across
what
> seemed to be a simple problem, but i couldn't figure out how to do it.
>
> say i was plotting y=x^2, and i wanted to shade the region under the graph
> only between x=2 to x=4 over a range of {x, 0, 5}, is there a way to do
> this? i tried FilledPlot, but it filled the entire area under the graph.
>
> thank you!
>
>
>