Look at the xpd argument to the par function. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111
> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Miguel Lacerda > Sent: Tuesday, July 21, 2009 8:21 AM > To: r-help@r-project.org > Subject: [R] Background colour of axis > > Hi, > > I would like to be able to shade the background of part of an axis. To > illustrate, consider the following code: > > par(xaxt="n") > x=1:10 > y=rnorm(10,0,1) > plot(x,y,type="l",xlab=NA) > mtext(text=LETTERS[1:10], side=1, at=1:10) > > How can I make the background behind, say, "G H I" on the x-axis red? I > have > tried using "polygon," but cannot seem to get it to plot outside the > graph > borders. > > Any suggestions? > > Miguel > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.