circles | R Documentation |
Draw circles in a flexible way.
circles( x, y = x, radi = 1, from = 0, to = 2 * pi, incr = 0.01, pie = FALSE, clockwise = FALSE, add = TRUE, ... )
x, y |
the x and y coordinates of the centers of the circles. |
radi |
the radii of the circles. |
from |
the angles, expressed in radians, from which circles are drawn. |
to |
the angles, expressed in radians, to which circles are drawn. |
incr |
increments between two points to be linked (expressed in radians). |
pie |
a logical. If |
clockwise |
a logical. Shall circles and arcs be drawn clockwise?
Defaut is |
add |
a logical. Should the circles be added on the current plot? |
... |
additional arguments to be passed to |
The number of circles drawn is given by the maximum argument length amng
x
, y
, radi
, from
and to
arguments.
Sizes are adjusted (i.e. repeated over) with rep_len()
function.
An invisible list of data.frame
of two columns including the
coordinates of all circles.
graphics::symbols()
, plotrix::draw.circle()
, plotrix::draw.arc()
.
# Example 1: plot0() circles(x = 0) # Example 2: plot0() circles(x = -.5, radi = 0.45, from = 0.5 * pi, to = 0.25 * pi) circles(x = .5, radi = 0.45, from = 0.5 * pi, to = 0.25 * pi, pie = TRUE) circles(x = .5, y = -.5, radi = 0.45, from = 0.5 * pi, to = 0.25 * pi, pie = TRUE, clockwise = TRUE) # Example 3: plot0() circles(matrix(-.5 + .5 * stats::runif(18), ncol = 3)) # Example 4: plot0(x = c(-2, 2), y = c(-2, 2), asp = 1) circles(x = c(-1, 1), c(1, 1, -1, -1), from = pi * seq(0.25, 1, by = 0.25), to = 1.25 * pi, col = 2, border = 4, lwd = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.