Try:
x <- 1:10 # test data
plot(x ~ x, type = "n")
u <- par("usr")
rect(u[1], u[3], u[2], u[4], col = "grey", border = "red")
points(x ~ x)
On 8/28/06, Arun Kumar Saha <arun.kumar.saha at gmail.com>
wrote:> Dear all R users,
>
> Is there any effective way to change the body color of any plot? I am aware
> of the function par(bg="black"), but the problem with this is, it
change the
> color of entire graphics window. But I want to see that only plot area will
> have color for example RED and rest of the area should have BLACK color.
>
> And I also I want to know is there any way to change the border-color
(which
> is by default BLACK) of the plot area.
>
> Hope anyone can help me to solve this.
>
> Thanks and regards,
> Arun
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>