Re: [R] Need help to draw a plot

From: Barry Rowlingson <>
Date: Mon, 23 Jun 2008 14:38:26 +0100

Ron Michael wrote:
> can i have some instruction on how to draw this type of plot in R :
> ? Regards,

  The black curve and it's grey friends are probably easily done with plot or matplot, but you need to make sure the X-axis extends far enough to the right to get the red curve in.

  The vertical and horizontal lines you can do with abline(v=1.0)

  The red curve looks like a normal distribution turned sideways. You could do this with lines() as well, but switching the X and Y coords from what you'd usually do. You'll need par()$usr to get the vertical range to compute the normal. Here's a fairly close facsimile except I couldn't be bothered to make the grey lines look exactly like your plot!

makeplot <- function(){





   xup=seq(par()$usr[3],par()$usr[4],len=50)    yup=dnorm(xup,mean,sd)/8
} mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 23 Jun 2008 - 13:47:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 23 Jun 2008 - 14:30:59 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive