plotCircle | R Documentation |
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,
...
)
x |
A numeric vector or unit object specifying circle x-locations relative to center. |
y |
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. |
r |
A numeric vector or unit object specifying radii. |
default.units |
A string indicating the default units to use
if |
linecolor |
A character value specifying circle line color.
Default value is |
lwd |
A numeric specifying circle line width.
Default value is |
lty |
A numeric specifying circle line type.
Default value is |
fill |
A character value specifying circle fill color.
Default value is |
alpha |
Numeric value specifying color transparency.
Default value is |
params |
An optional pgParams object containing relevant function parameters. |
... |
Additional grid graphical parameters. See gpar. |
Returns a circle
object containing
relevant placement and grob information.
grid.circle
## 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"
)
plotCircle(
x = 1.4, y = 0.5, r = 0.1, fill = "black",
default.units = "inches"
)
## 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")
## Hide page guides
pageGuideHide()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.