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, -- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Olivier MARTIN PhD student phone : (33) 04 76 61 53 55 Projet IS2 06 08 67 93 42 INRIA Rhone-Alpes fax : (33) 04 76 61 54 77 655, Av. de l'Europe Montbonnot e-mail: olivier.martin at inrialpes.fr 38334 Saint Ismier cedex web : http://www.inrialpes.fr/is2/people/omartin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
At 08:56 20/08/02 +0200, you 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.There is an example in demo(graphics) where the colour of the background within the plotting is not the same than in the margins; is it what you want? (The code is there of course.) EP>Regards, > >-- >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.->Olivier MARTIN >PhD student phone : (33) 04 76 61 53 55 >Projet IS2 06 08 67 93 42 >INRIA Rhone-Alpes fax : (33) 04 76 61 54 77 >655, Av. de l'Europe >Montbonnot e-mail: olivier.martin at inrialpes.fr >38334 Saint Ismier cedex web :http://www.inrialpes.fr/is2/people/omartin>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.->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 >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._> >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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. >This may not be the easiest way, but...> plot(1:5,type="n") > pd<-par("usr") > rect(pd[1],pd[3],pd[2],pd[4],col="Gray") > par(new=T) > plot(1:5)Jim -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "Jim" == Jim Lemon <bitwrit at ozemail.com.au> >>>>> on Tue, 20 Aug 2002 22:02:22 +1000 writes:Jim> 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. >> Jim> This may not be the easiest way, but... >> plot(1:5,type="n") >> pd<-par("usr") >> rect(pd[1],pd[3],pd[2],pd[4],col="Gray") >> par(new=T) >> plot(1:5) The easiest way most probably being something like plot(1:10, panel.first = {U <- par("usr") rect(U[1],U[3],U[2],U[4],col="cornsilk", border="black")}, main = "Extra background for plot()") ------ Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._