plotCircle: Plot a circle within a plotgardener layout

View source: R/plotCircle.R

plotCircleR Documentation

Plot a circle within a plotgardener layout

Description

Plot a circle within a plotgardener layout

Usage

plotCircle(
    x,
    y,
    r,
    default.units = "inches",
    linecolor = "black",
    lwd = 1,
    lty = 1,
    fill = NA,
    alpha = 1,
    params = NULL,
    ...
)

Arguments

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 r, x, or y are only given as numerics or numeric vectors. Default value is default.units = "inches".

linecolor

A character value specifying circle line color. Default value is linecolor = "black".

lwd

A numeric specifying circle line width. Default value is lwd = 1.

lty

A numeric specifying circle line type. Default value is lty = 1.

fill

A character value specifying circle fill color. Default value is fill = NA.

alpha

Numeric value specifying color transparency. Default value is alpha = 1.

params

An optional pgParams object containing relevant function parameters.

...

Additional grid graphical parameters. See gpar.

Value

Returns a circle object containing relevant placement and grob information.

See Also

grid.circle

Examples

## 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()

PhanstielLab/plotgardener documentation built on May 7, 2024, 4:21 a.m.