[R] Polygon shading line colors

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Oct 30 16:23:07 CET 2007


On Tue, 30 Oct 2007, Luke Spadavecchia wrote:

> Hi there,
>
> I'm having trouble working out how to change the colors of polygon
> shading lines. If I plot a polygon with
>
> polygon(poly,density=30,borders=gray(0.5))
>
> I get gray borders but black shading lines; I have tried adding
> col=gray(0.5), bg=gray(0.5) and fg=gray(0.5), but no luck.

Really?  col should work, and does for me.

What will not work is 'borders' : it is 'border'.  A working example
based on the help page is

plot(c(1,9), 1:2, type="n")
polygon(1:9, c(2,1,2,1,NA,2,1,2,1), density=5, col="blue", border=gray(0.5))


> How can I change the colors of the shading? The help file doesn't
> seem to detail this, so any suggestions would be greatly appreciated.
>
> Many thanks
>
> Luke Spadavecchia
>
> ______________________________________________
> R-help at r-project.org 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.

As it says, working code is expected.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list