polygon | R Documentation |
Plot a polygon by specifying vertices. See polygon
for more details.
polygon(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments. See '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
polygon
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.