[R] colors for background and plotting area

ben@zoo.ufl.edu ben at zoo.ufl.edu
Sat Sep 2 15:45:21 CEST 2000


  Use "par" to find out where the boundaries/axes are, and "rect" to draw
the picture ... the 6th plot in demo(graphics) does the same thing.

  For example:

## code for coloring background

x <- runif(10)
y <- runif(10)

plot(x,y,type="n")
u <- par("usr")
rect(u[1],u[3],u[2],u[4],col="magenta")
points(x,y)


On Sat, 2 Sep 2000, Ramon Diaz-Uriarte wrote:

> Dear all,
> 
> I am trying to prepare some figures where I'd like the color of the plot region
> (i.e., the area bounded by the axes) to be different from the margin area
> (i.e., the area of the figure not within the axes region).  I can use "bg" but
> that changes the background of everything? How can I accomplish what I want?
> 
> Thanks,
> 
> Ramon
> 
>  -- 
> Ramón Díaz-Uriarte
> Triana 47
> 28016 Madrid
> Spain
> 
> email:ramon-diaz at teleline.es
> Phone: +-34-917-730-620
>        +-34-657-186-407	
> 
> 
> 
> 
> 
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list