Message Boards Message Boards

0
|
3352 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

[?] Draw a bell curve with specified shading under the curve?

Posted 5 years ago

Pardon the newbie-type question, but I'm struggling with the Mathematica syntax for a bell curve. All I want to draw is a bell curve with mean 3 and SD of 0.3, but with the region between the graph, the x-axis, -2sigma and +1 sigma shaded (where sigma = standard deviation). Can someone help?

TIA

Geoffrey

POSTED BY: Geoffrey Marnell
2 Replies

Thank you very much Rohit. Geoffrey

POSTED BY: Geoffrey Marnell
Posted 5 years ago

Geoffrey,

One way to do this is to combine two plots.

p1 = Plot[PDF[NormalDistribution[3, 0.3], x], {x, 1.5, 4.5}];
p2 = Plot[PDF[NormalDistribution[3, 0.3], x], {x, 2.4, 3.3}, Filling -> 0, FillingStyle -> Yellow];

Show[{p1, p2}]

enter image description here

POSTED BY: Rohit Namjoshi
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