lexis_polygon {LexisPlotR}R Documentation

Plot a polygon inside a Lexis grid Takes an existing Lexis grid and adds a polygon.

Description

Plot a polygon inside a Lexis grid Takes an existing Lexis grid and adds a polygon.

Usage

lexis_polygon(lg, x, y, group = 1, fill = lexisplotr_colours()[4],
  alpha = 0.7)

Arguments

lg

an existing object originally created with lexis_grid().

x

vector describing the x coordinates of the polygon. Format: YYYY-MM-DD.

y

vector describing the y coordinates of the polygon

group

vector describing the groups of coordinates.

fill

character, fill colour of the polygon.

alpha

numeric, transparency of the fill colour. Default: 0.7.

Details

The function can be used to plot a polygon inside a Lexis grid.

Author(s)

Philipp Ottolinger

Examples

## Not run: 
library(LexisPlotR)
lg <- lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)
lexis_polygon(lg, x = c("1901-06-30", "1904-06-30", "1904-06-30", "1901-06-30"), y = c(2,2,4,4))

## End(Not run)

[Package LexisPlotR version 0.4.0 Index]