[R] plot and bg

E. D. Isaia isaia at econ.unito.it
Sat Aug 24 05:12:59 CEST 2002


If it helps you

x<-runif(100,10,20)
y<-2*x+rnorm(length(x),0,1)
xticks<-pretty(x)
yticks<-pretty(y)

par(bg="gray")
coord <- par("usr")
plot(x, type="n",axes=FALSE,ann=FALSE,xlim=range(xticks),ylim=range(yticks))
rect(coord[1],coord[3],coord [2],coord [4],col="yellow",border="navy")

points(x,y,pch=20,cex=1.5,col="red")
axis(1, col.axis="navy")
axis(2, col.axis="navy")

Best, isaia

Olivier Martin wrote:

> Hi all,
>
> I would like to plot some points and define the bg color of my graphics.
> But the bg parameter set is defined for the. whole graphic.
> In fact, i would like to use something like :
>
> box(bg=gray(0.9)).
>
> So, the background  concerns only the plot region  and not the main 
> title, the x title and the y title.
>
> The option col for the function box() concerns the contour and there 
> is no option for the background.
>
> Regards,
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Ennio D. Isaia
~ Dep. of Statistics & Mathematics, University of Torino
~ Piazza Arbarello, 8 - 10128 Torino (Italy)
~ Phone: +39 011 670 62 51 ~~ Fax: +39 011 670 62 39
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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