par(mar=c(5,5,1,1))

## Density figure
x <- rnorm(30)
plot(ecdf(x),do.points=FALSE,verticals=TRUE,ylab=expression(hat(F)(x)),main="")
plot(x,rep(100,30),type="h",yaxt="n",ylim=c(0,100),ylab=expression(paste(hat(f)(x),", plug-in estimate")))
abline(h=0)

## IF: mean
xx <- seq(-1,1,len=101)
plot(xx,xx,type="l",xaxt="n",yaxt="n",xlab="x",ylab=expression(hat(L)(x)))
axis(1,at=0,label=expression(bar(x)))
abline(h=0,col='gray80')
axis(2,at=0,label=0)

## IF: variance
xx <- seq(-1,1,len=101)
plot(xx,xx^2-0.5,type="l",xaxt="n",yaxt="n",xlab="x",ylab=expression(hat(L)(x)))
axis(1,at=0,label=expression(bar(x)))
abline(h=0,col='gray80')
axis(2,at=c(-0.5,0),label=c(expression(-hat(sigma)^2,0)))

## IF: quantiles
xx <- seq(-1,1,len=101)

plot(xx,ifelse(xx>0,0.5,-0.5),type="l",xaxt="n",yaxt="n",xlab="x",ylab="L(x)",main="Median")
axis(1,at=0,label=expression(theta))
abline(h=0,col='gray80')
axis(2,at=0,label=0)

plot(xx,ifelse(xx>0,.25,.25-1),type="l",xaxt="n",yaxt="n",xlab="x",ylab="L(x)",main="25th percentile")
axis(1,at=0,label=expression(theta))
abline(h=0,col='gray80')
axis(2,at=0,label=0)
