Skip to content
Prev 7543 / 29559 Next

plot polygons - transparent holes/island

On Mon, 1 Feb 2010, Paulo Eduardo Cardoso wrote:

            
The image cannot be reproduced with your plotting order, because the 
polygons overpaint the points. Crucially, the big square is completely 
painted. You also have two Polygons objects, one a square with a round 
hole, the other an island filling the hole. With your objects, you could 
do:

plot(areas[1,], pbg="white", col="grey85", border="grey50") 
# set up background polygon and paint hole
plot(areas[2,], angle=45, density=8, border="grey50", col="grey50",
   add=TRUE)
# hatch the island polygon
points(pontos[pontos$point=="in",], pch=16)
# add the in points
points(pontos[pontos$point=="out",], pch=22, col="grey50", bg="grey50")
# and the out points

If your output devive uses and alpha channel, you may be able to find 
other ways forward, but they will not be portable across devices.

Hope this helps,

Roger