Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8039
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Filling question |
| Date | 2012-01-20 06:57 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jfb393$hs8$1@smc.vnet.net> (permalink) |
| References | <jf8vdp$5p3$1@smc.vnet.net> |
Gabriel Landi wrote:
> Here is a silly question: How to fill the region between two overlapping
> curves? e.g., the region near x=4 in
>
> Plot[{Exp[-(x - 3)^2], Exp[-(x - 5)^2]}, {x, 0, 10}
>
> Thanks in advance,
>
> Gabriel Landi
>
You may use a RegionPlot:
f[x_] = Exp[-(x - 3)^2];
g[x_] = Exp[-(x - 5)^2];
{xs, ys} = {x, f[x]} /. First@Solve[f[x] == g[x], x] // Quiet
region = y <= f[x] && x >= xs || y <= g[x] && x <= xs ;
Show[Plot[{f[x], g[x]}, {x, 0, 10}],
RegionPlot[region, {x, 0, 10}, {y, 0, 10}]]
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Filling question Gabriel Landi <gtlandi@gmail.com> - 2012-01-19 11:39 +0000 Re: Filling question David Skulsky <edskulsky@gmail.com> - 2012-01-20 06:56 +0000 Re: Filling question Peter Breitfeld <phbrf@t-online.de> - 2012-01-20 06:57 +0000
csiph-web