draw_circles: Plot circles

Description Usage Arguments Details Value See Also Examples

View source: R/plotting.R

Description

Plots any numbers of circles using base R graphics, starting by plotting the first circle on the bottom and going up.

Usage

1
2
draw_circles(x, y, r, polygon_args = list(), vertices = 500, add = FALSE,
  asp = 1, ...)

Arguments

x

x Coordinates for the circles' centers

y

y coordinates for the circles' centers

r

Radiuses of the circles

polygon_args

List of arguments to pass to polygon to adjust borders, fill, shadings, etc.

vertices

The number of vertices used for drawing the circumference of each circle.

add

If FALSE initializes a new plotting frame with plot.

asp

Controls the aspect ratio of the plot. Will not produce circles if it ses to anything other than 1.

...

Arguments to pass to plot

Details

draw_circles uses polygon to draw the circles, which means that they are technically just circle-shaped polygons. The function is vectorized and can handle any number of circles.

Value

Plots circles either in the current plotting window or on a new plotting window.

See Also

polygon, plot

Examples

1
2
3
4
5
6
7
8
x <- runif(3)
y <- runif(3)
r <- runif(3, 0.2, 0.6)

draw_circles(x, y, r, polygon_args = list(border = "transparent",
                                          col = c("goldenrod1",
                                                  "steelblue1",
                                                  "black")))

jolars/euclidr documentation built on May 19, 2019, 7:25 p.m.