Hello, I cannot figure out how to shade between two lines in a plot. For example, if I am trying to plot a confidence envelope and I would like to shade the interior of the envelope grey. Is this possible in R? Thanks in advance. Heather Lynch
Heather Joan Lynch said the following on 2005-04-28 16:14:> I cannot figure out how to shade between two lines in a plot. For > example, if I am trying to plot a confidence envelope and I would like to > shade the interior of the envelope grey. Is this possible in R?First, citing Simon `Yoda' Blomberg, "This is R. There is no if. Only how." So, yes, this is possible. How? Try ?polygon. HTH, Henric
On Thu, 2005-04-28 at 10:14 -0400, Heather Joan Lynch wrote:> Hello, > > I cannot figure out how to shade between two lines in a plot. For > example, if I am trying to plot a confidence envelope and I would like to > shade the interior of the envelope grey. Is this possible in R? > > Thanks in advance.You might want to review some of the examples in ?polygon for some hints on how to approach this. You might find the second one most applicable here. HTH, Marc Schwartz
There is a force function in the Base package! Does that counteract the evil of the try function? Erin
On Thu, 2005-04-28 at 13:53 -0400, Andy Bunn wrote:> > PS 6 days to the big Jedi holiday! > > I wonder if anybody who gave the matter any thought would be surprised that > the R-Help list is populated by ubergeeks.Perhaps, but we all managed to miss Pi Day last month....> Pi.Day <- as.POSIXct("2005-03-14 13:59:27")> Pi.Day <- as.numeric(gsub("0", "", format(Pi.Day, "%m.%d%I%M%S")))> print(Pi.Day, 8)[1] 3.1415927 ;-) Marc
Just a little bit of trivia. The 2001 Census in Australia had a significant group of people who responded to the question of religion with the answer Jedi or Jedi Knight. Unfortunately the Australian Bureau of Statistics is a bit fuddy duddy about the issue as they see it as a trivialisation of the question rather than as a serious sociological (not necessarily religious) response by certain sections of the community, otherwise we might have had a complete profile of said ubergeeks. One small point is that the question on religion is the only voluntary (or optional as the ABS puts it) question in the form. www.abs.gov.au/websitedbs/D3110124.NSF/ 0/86429d11c45d4e73ca256a400006af80?OpenDocument (you need to keep the space before the zero otherwise you end up elsewhere on the ABS site. The document is called "The 2001 Census, Religion and the Jedi") Tom> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Marc Schwartz > Sent: Friday, 29 April 2005 2:37 AM > To: Andy Bunn > Cc: R-Help; Barry Rowlingson > Subject: RE: [R] shading in line plots > > > On Thu, 2005-04-28 at 13:53 -0400, Andy Bunn wrote: > > > PS 6 days to the big Jedi holiday! > > > > I wonder if anybody who gave the matter any thought would > be surprised that > > the R-Help list is populated by ubergeeks. > > Perhaps, but we all managed to miss Pi Day last month.... > > > Pi.Day <- as.POSIXct("2005-03-14 13:59:27") > > > Pi.Day <- as.numeric(gsub("0", "", format(Pi.Day, "%m.%d%I%M%S"))) > > > print(Pi.Day, 8) > [1] 3.1415927 > > > ;-) > > Marc > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
I have snippets of code that I have either taken from examples or off of the list. I apologise to those I have stolen it from but I didn't keep the proper references. n <- 100 xx <- c(0:n, n:0) yy <- c(c(0,cumsum(rnorm(n))), rev(c(0,cumsum(rnorm(n))))) plot (xx, yy, type="n", xlab="Time", ylab="Distance") polygon(xx, yy, col="gray", border = "red") title("Distance Between Brownian Motions") The list also has http://finzi.psych.upenn.edu/R/Rhelp02a/archive/12463.html http://finzi.psych.upenn.edu/R/Rhelp02a/archive/16809.html http://finzi.psych.upenn.edu/R/Rhelp02a/archive/0047.html Tom> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Heather > Joan Lynch > Sent: Thursday, 28 April 2005 10:14 PM > To: r-help at stat.math.ethz.ch > Subject: [R] shading in line plots > > > Hello, > > I cannot figure out how to shade between two lines in a plot. For > example, if I am trying to plot a confidence envelope and I > would like to > shade the interior of the envelope grey. Is this possible in R? > > Thanks in advance. > > Heather Lynch > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >