[R] fill the area outside a polygon
Adrian Dușa
dusa.adrian at unibuc.ro
Wed Dec 2 17:31:44 CET 2015
On Wed, Dec 2, 2015 at 5:19 PM, David L Carlson <dcarlson at tamu.edu> wrote:
>
> Using only base graphics, one solution would be to embed the inner
polygon in the outer one and turn off the border:
>
> par(mai=c(0, 0, 0, 0))
> plot(1:100, type="n")
> polygon(c(0, 100, 100, 0, 0, 20, 80, 80, 20, 20, 0),
> c(0, 0, 100, 100, 0, 20, 20, 80, 80, 20, 0), col="lightblue",
border=NA)
I see what you did, interesting.
I do need the border though, although if this is the only solution, perhaps
I could live without it.
It's working on a Windows machine (which I presume you are using), but
under MacOS I only get the entire big polygon filled, including the hole
in the middle.
Thanks,
Adrian
--
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr.90
050663 Bucharest sector 5
Romania
[[alternative HTML version deleted]]
More information about the R-help
mailing list