Plot a circle within a plotgardener layout
plotCircle(
x,
y,
r,
default.units = "inches",
linecolor = "black",
lwd = 1,
lty = 1,
fill = NA,
alpha = 1,
params = NULL,
...
)
A numeric vector or unit object specifying circle x-locations relative to center.
A numeric vector, unit object, or a character vector of values containing a "b" combined with a numeric value specifying circle y-locations relative to center. The character vector will place circle y-locations relative to the bottom of the most recently plotted plot according to the units of the plotgardener page.
A numeric vector or unit object specifying radii.
A string indicating the default units to use
if r
, x
, or y
are only given as numerics or
numeric vectors. Default value is default.units = "inches"
.
A character value specifying circle line color.
Default value is linecolor = "black"
.
A numeric specifying circle line width.
Default value is lwd = 1
.
A numeric specifying circle line type.
Default value is lty = 1
.
A character value specifying circle fill color.
Default value is fill = NA
.
Numeric value specifying color transparency.
Default value is alpha = 1
.
An optional pgParams object containing relevant function parameters.
Additional grid graphical parameters. See gpar.
Returns a circle
object containing
relevant placement and grob information.
## Create a page
pageCreate(width = 2, height = 2, default.units = "inches")
## Plot two circles, one at a time
plotCircle(
x = 0.6, y = 0.5, r = 0.1, fill = "black",
default.units = "inches"
)
#> circle[circle1]
plotCircle(
x = 1.4, y = 0.5, r = 0.1, fill = "black",
default.units = "inches"
)
#> circle[circle2]
## Plot a vector of circles
xVals <- 1 + (0.5 * cos(seq(0, pi, pi / 8)))
yVals <- 1 + (0.5 * sin(seq(0, pi, pi / 8)))
plotCircle(x = xVals, y = yVals, r = 0.05, default.units = "inches")
#> circle[circle2]
## Hide page guides
pageGuideHide()