Skip to contents

This routine does the inverse of 'polygon': it colours everything outside a given polygnon. This may be useful for e.g. blanking out a plot outside certain borders. This routine is quite simple and may not work under all circumstances.

Usage

antipolygon(data,xylim=DomainExtent(.Last.domain()), bg='white')

Arguments

data

A polygon (x and y columns).

bg

Colour to use.

xylim

Boundaries for the 'antipolygon'. Usually the boundaries of the presentt plot.

Details

antipolygon() works by adding the 4 corner points to the polygon, thus 'inverting' it.

See also

Examples

 if (FALSE) {
mask <- project(map("world","Belgium",fill=0,plot=FALSE))
xylim <- DomainExtent(datafield)
antipolygon(mask,xylim=xylim)
}