polygon: gsplot polygon

View source: R/polygon.R

polygonR Documentation

gsplot polygon

Description

Plot a polygon by specifying vertices. See polygon for more details.

Usage

polygon(object, ...)

Arguments

object

gsplot object

...

Further graphical parameters may also be supplied as arguments. See 'Details'.

Details

Additional graphical parameter inputs:

  • x vector specifying the x values of the vertices

  • y vector specifying the y values of the vertices

  • density density of shading lines (lines per inch), NULL means no shading, NA suppresses shading and allows color fill

  • angle angle of shading lines (degrees)

  • col shade or fill color(s), NA means no fill (transparent)

  • border color of border, NA means no border, TRUE indicates the same color as shading lines

  • lty line type for borders and shading

  • lwd line width for borders and shading

  • legend.name name that appears in the legend, see legend for more legend parameters

See Also

polygon

Examples

gs <- gsplot() %>%
   polygon(x=c(1,2,5), y=c(1,4,0.5), 
           density=10, col="darkgreen")
gs

gs <- gsplot() %>%
   polygon(x=c(2,6.5,12,10.5,14,9,6.5,5,0,3.5),
           y=c(0,2.5,0,5,8.5,9,14,9,8.5,5),
           density=NA, col="blue", border=NA) 
gs

USGS-R/gsplot documentation built on April 17, 2023, 8:45 p.m.