Re: [R] Shading underneath a line plot.

2008-10-24 Thread Greg Snow
Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > project.org] On Behalf Of Alastair Andrew > Sent: Friday, October 24, 2008 10:17 AM > To: r-help@r-project.o

Re: [R] Shading underneath a line plot.

2008-10-24 Thread jim holtman
Is this what you want: mydata <- c(268,251,254,250,244,246,247,243,241,243) plot(mydata, type="o") # choose a min y value minY <- 240 polygon(c(1, 1:10, 10), c(240, mydata, 240), col='red') On Fri, Oct 24, 2008 at 12:17 PM, Alastair Andrew <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm sure this sho

[R] Shading underneath a line plot.

2008-10-24 Thread Alastair Andrew
Hi, I'm sure this should be fairly simple to do but I haven't found an example. I have 10 data points which are plotted as a line, I want to shade under this line with a colour. Other examples have shading under curves where there are two sets of data use polygons. mydata <- c(268,251,254,250,2