Message Boards Message Boards

0
|
1816 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Adding shaded areas to a plot?

Posted 3 years ago
f[x_] := 1/Sqrt[2 [Pi]] Exp[-(x^2/9)]
Plot[f[x], {x, -10, 10}]

From here on how can I create the same image

Attachment

POSTED BY: micheal yousri
6 Replies
f[x_] := 1/Sqrt[2 \[Pi]] Exp[-(x^2/9)]
AREA = Integrate[f[x], {x, -Infinity, -2}] + Integrate[f[x], {x, 1, Infinity}]
AREA // N
(*1.04277*)
POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

Sorry I asked the question wrong. I have to draw the same picture. So not the volume of the shaded area.

POSTED BY: micheal yousri

I have calculated area not volume.

POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

Ok, I understand thanks, but how can I create that image.

POSTED BY: micheal yousri

Maybe so:

Show[{Plot[f[x], {x, -7, -2}, Filling -> Bottom, 
 FillingStyle -> {Black}, AxesOrigin -> {0, 0}, 
 AxesLabel -> {x, F[x]}], 
 Plot[f[x], {x, 1, 7}, Filling -> Bottom, FillingStyle -> {Black}], 
 Plot[f[x], {x, -7, 7}]}, PlotRange -> All]
POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

Thank you very much my friend :)

POSTED BY: micheal yousri
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract