[R] colors for background and plotting area

Ramon Diaz-Uriarte ramon-diaz at teleline.es
Mon Sep 4 13:16:12 CEST 2000


Thank you very much to P. Dalgaard, E. Paradis and B. Bolker for their answers.
Basically, the 6th example in demo(graphics) shows how to do it: specify bg,
then use par to find boundaries of axes, color that rectangle with rect,
and add the points/lines.

> x <- rnorm(10)
> par(bg= "red")
> plot(x, type= "n")
> usr <- par("usr")
> rct(usr[1], usr[3], usr[2], usr[4], col = "blue")
> lines(x, col = "yellow")
 


Ramon


**** question ****
On Sat, 02 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list