Here is the code for what I have right now:
library(ggplot2) normal <- function(mu, sigma, x){ 1/(sigma*sqrt(2*pi))*exp(-((x-mu)/sigma)^2) } normal_expr <- function(){ expression(N~bgroup('(',paste(x, '; ',mu, ',', sigma),')') == frac(1, sigma~sqrt(2*pi)) ~ exp~bgroup('[',-~bgroup('(',frac(x-mu,sigma),')')^2,']')) } ggplot(data.frame(x=c(-3,3)), aes(x=x, color=g)) + stat_function(data=data.frame(x=c(-2, 3.5), g=factor(1)), fun=normal, geom='line', args=list(mu=0.5, sigma=2)) + stat_function(data=data.frame(x=c(-2, 3.5), g=factor(2)), fun=normal, geom='line', args=list(mu=1, sigma=2)) + scale_x_continuous(breaks=seq(from=-2, to = 3, by=1)) + ylab(normal_expr()) + coord_cartesian(ylim=c(0, 0.2)) + scale_color_manual('',values=c('blue','red', 'red'), labels=c(expression(N(mu == 0.5, sigma==2)),expression(N(mu == 1, sigma==2)))) + theme(panel.background = element_rect(fill='white'),
Here is the result:

From what I am compiling from Chang's R Graphics Cookbook, I should add something like
normal_shade <- function(mu, sigma, x){ y <- normal(mu=mu, sigma=sigma, x) y[x < 0 | x > 2] <- NA return(y) } + stat_function(fun=normal_shade, geom = 'area', fill = 'red', alpha = 0.2, args = list(mu = 1, sigma = 2))
to the code above to get shading under the red line above from x = 0 to x = 2.
Here's what happens:
library(ggplot2) normal <- function(mu, sigma, x){ 1/(sigma*sqrt(2*pi))*exp(-((x-mu)/sigma)^2) } normal_expr <- function(){ expression(N~bgroup('(',paste(x, '; ',mu, ',', sigma),')') == frac(1, sigma~sqrt(2*pi)) ~ exp~bgroup('[',-~bgroup('(',frac(x-mu,sigma),')')^2,']')) } normal_shade <- function(mu, sigma, x){ y <- normal(mu=mu, sigma=sigma, x) y[x < 0 | x > 2] <- NA return(y) } ggplot(data.frame(x=c(-3,3)), aes(x=x, color=g)) + stat_function(data=data.frame(x=c(-2, 3.5), g=factor(1)), fun=normal, geom='line', args=list(mu=0.5, sigma=2)) + stat_function(data=data.frame(x=c(-2, 3.5), g=factor(2)), fun=normal, geom='line', args=list(mu=1, sigma=2)) + stat_function(fun=normal_shade, geom = 'area', fill = 'red', alpha = 0.2, args=list(mu=1, sigma=2)) + scale_x_continuous(breaks=seq(from=-2, to = 3, by=1)) + ylab(normal_expr()) + coord_cartesian(ylim=c(0, 0.2)) + scale_color_manual('',values=c('blue','red', 'red'), labels=c(expression(N(mu == 0.5, sigma==2)),expression(N(mu == 1, sigma==2)))) + theme(panel.background = element_rect(fill='white'),
I searched many times, but could not get around this problem.