How to change the color of Plot area.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to change the color of Plot area.

Arun.stat
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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to change the color of Plot area.

Gabor Grothendieck
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 <[hidden email]> 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]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.