Question: I'm brand new to R, and I'm facing a problem without much in- class resources. I need to do something that I'm sure is very simple. Can someone point me in the right direction? This is my task:

> 
> Let X denote the monthly return on Microsoft Stock and let Y denote
>  the monthly return on Starbucks stock. Assume that X∼N(0.05,(0.10)2)
>  and Y∼N(0.025,(0.05)2).
> 
> 
> Using a grid of values between –0.25 and 0.35, plot the normal curves
>  for X and Y. Make sure that both normal curves are on the same plot.
> 
> 
> 

I've only been able to get a randomly generated normal distribution generated, but not both on the same plot, and not by specifying mean and st dev. Big thanks in advance.

Answer: 
use the functions lines or points, i.e.

```
s <- seq(-.25,.35,0.01)
plot(s, dnorm(s,mean1, sd1), type="l")
lines(s, dnorm(s,mean2, sd2), col="red")

```

also, check the function par (using 
 ?par
)
for plotting options, common options include labels (xlab/ylab), plotlimits (xlim/ylim), colors(col), etc...
As suggested by @mnel, we can use ggplot2 to plot several normal distributions in one plot. (I found this post is quite old, but I didn't find an easy answer to this question after searching in some other posts, so I would like to post an answer here)

```
base <- ggplot() + xlim(-10, 10)
base +
  geom_function(aes(colour = "Original prior"), fun = dnorm, args = list(mean = 1, sd = 2)) +
  geom_function(aes(colour = "Prior 1"), fun = dnorm, args = list(mean = 2, sd = 2)) +
  geom_function(aes(colour = "Prior 2"), fun = dnorm, args = list(mean = 3, sd = 4)) +
  geom_function(aes(colour = "Prior 3"), fun = dnorm, args = list(mean = 4, sd = 2))

```

[normal distribution](https://i.stack.imgur.com/SWWsV.png)