ellipse | R Documentation |
Draw ellipses in a flexible way.
ellipse( x = 0, y = x, mjradi = 1, mnradi = 0.5, from = 0, to = 2 * pi, rot = 0, incr = 0.01, pie = FALSE, ... )
x |
the x coordinates of the centers of the ellipses. |
y |
same as |
mjradi |
the major radii of the ellipses. |
mnradi |
the minor radii of the ellipses. |
from |
the angles, expressed in radians, from which ellipses are drawn. |
to |
the angles, expressed in radians, to which ellipses are drawn. |
rot |
the rotation angles (in degree) of the ellipses. |
incr |
increments between two points to be linked (expressed in radians). |
pie |
a logical. If |
... |
additional arguments to be passed to |
For a rotation angle of 0, major radii refer to the one along the x axis.
The number of circles drawn is given by the maximum argument length among
x
, y
, radi
, from
and to
arguments. Note vector length are adjusted
using rep_len()
.
There is a similar function, called draw.ellipse
, in the package plotrix
.
# Example 1: plot0(asp = 1) ellipse() # Example 2: plot0() for (i in seq(0, 360, 30)) ellipse(rot = i) # Example 3: plot0() ellipse(matrix(-.5 + .5 * stats::runif(18), ncol = 3)) # Example 4: plot0(x = c(-2, 2), y = c(-2, 2), asp = 1) ellipse( 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.