[R] Background colour of axis

Greg Snow Greg.Snow at imail.org
Tue Jul 21 18:29:00 CEST 2009


Look at the xpd argument to the par function.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Miguel Lacerda
> Sent: Tuesday, July 21, 2009 8:21 AM
> To: r-help at 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 at 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.




More information about the R-help mailing list