Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8016 > unrolled thread
| Started by | Gabriel Landi <gtlandi@gmail.com> |
|---|---|
| First post | 2012-01-19 11:39 +0000 |
| Last post | 2012-01-20 06:57 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | Gabriel Landi <gtlandi@gmail.com> |
|---|---|
| Date | 2012-01-19 11:39 +0000 |
| Subject | Filling question |
| Message-ID | <jf8vdp$5p3$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | David Skulsky <edskulsky@gmail.com> |
|---|---|
| Date | 2012-01-20 06:56 +0000 |
| Message-ID | <jfb375$hro$1@smc.vnet.net> |
| In reply to | #8016 |
Here's one way:
Plot[{Exp[-(x - 3)^2], Exp[-(x - 5)^2],
Min[{Exp[-(x - 3)^2], Exp[-(x - 5)^2]}]}, {x, 0, 10},
Filling -> {3 -> 0}, PlotRange -> All]
David
[toc] | [prev] | [next] | [standalone]
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Date | 2012-01-20 06:57 +0000 |
| Message-ID | <jfb393$hs8$1@smc.vnet.net> |
| In reply to | #8016 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web