forked from PhanstielLab/plotgardener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb_plotPolygon.Rd
50 lines (37 loc) · 2.03 KB
/
bb_plotPolygon.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bb_plotPolygon.R
\name{bb_plotPolygon}
\alias{bb_plotPolygon}
\title{Plot a polygon within a BentoBox layout}
\usage{
bb_plotPolygon(x, y, default.units = "inches")
}
\arguments{
\item{x}{A numeric vector or unit object specifying polygon vertex x-locations.}
\item{y}{A numeric vector or unit object specifying polygon vertex y-locations.}
\item{default.units}{A string indicating the default units to use if \code{x} or \code{y} are only given as numeric vectors. Default value is \code{default.units = "inches"}.}
\item{linecolor}{A character value specifying polygon line color. Default value is \code{linecolor = "black"}.}
\item{lwd}{A numeric specifying polygon line width. Default value is \code{lwd = 1}.}
\item{lty}{A numeric specifying polygon line type. Default value is \code{lty = 1}.}
\item{fill}{A character value specifying polygon fill color. Default value is \code{fill = NA}.}
\item{alpha}{Numeric value specifying color transparency. Default value is \code{alpha = 1}.}
\item{id}{A numeric vector used to separate locations in \code{x} and \code{y} into multiple polygons. All locations with the same \code{id} belong to the same polygon.}
\item{id.lengths}{A numeric vector used to separate locations in \code{x} and \code{y} into multiple polygons. Specifies consecutive blocks of locations which make up separate polygons.}
\item{params}{An optional \link[BentoBox]{bb_assembly} object containing relevant function parameters.}
\item{...}{Additional grid graphical parameters. See \link[grid]{gpar}.}
}
\value{
Returns a \code{bb_polygon} object containing relevant placement and \link[grid]{grob} information.
}
\description{
Plot a polygon within a BentoBox layout
}
\examples{
## Create a BentoBox page
bb_pageCreate(width = 2, height = 2, default.units = "inches", xgrid = 0, ygrid = 0)
## Plot a 5-sided polygon
bb_plotPolygon(x = c(0.5, 1, 1.5, 1.25, 0.75), y = c(0.5, 0.25, 0.5, 1.25, 1.25), default.units = "inches")
}
\seealso{
\link[grid]{grid.polygon}
}