Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

circle

Draws a circle


Description

Draws a circle or an arc-circle on the current graphic device

Usage

circle(x = 0, y = 0, r = 1, theta = c(0, 360), n = 100, ...)

Arguments

x

x coordinate for the center of the circle

y

y coordinate for the center of the circle

r

radius of the circle

theta

start and stop angle

n

number of points for polygon object

...

arguments passed to polygon

Value

none

Author(s)

J.R. Lobry

See Also

Examples

par(mfrow = c(2, 2), mar = c(0,0,2,0))
setup <- function(){
  plot.new()
  plot.window(xlim = c(-1,1), ylim = c(-1,1), asp = 1)
}

setup()
circle(col = "lightblue")
title(main = "theta = c(0, 360)")

setup()
circle(col = "lightblue", theta = c(0, 270))
title(main = "theta = c(0, 270)")

setup()
circle(col = "lightblue", theta = c(-90, 180))
title(main = "theta = c(-90, 180)")

setup()
n <- 20
for(i in seq(0, 360, length = n)){
  circle(col = "lightblue", theta = c(i, i+360/(2*n)))
}
title(main = "many thetas")

seqinr

Biological Sequences Retrieval and Analysis

v4.2-16
GPL (>= 2)
Authors
Delphine Charif [aut], Olivier Clerc [ctb], Carolin Frank [ctb], Jean R. Lobry [aut, cph], Anamaria Necşulea [ctb], Leonor Palmeira [ctb], Simon Penel [cre], Guy Perrière [ctb]
Initial release
2022-05-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.