ellipse | R Documentation |
Add an ellipse in an existing plot
ellipse(
x0 = 0,
y0 = 0,
a = 1,
b = 2,
alpha = 0,
length = 1000,
col = NULL,
fill = NA,
border,
...
)
x0 |
x-coordinate of the ellipse center |
y0 |
y-coordinate of the ellipse center |
a |
Length of semi-major axis |
b |
Length of semi-minor axis |
alpha |
Rotation of the ellipse with regard to the X-axis in radian |
length |
How many points are generated to simulate the ellipse |
col |
Ellipse border color |
fill |
Ellipse fill color |
border |
Equivalent to |
... |
further parameters passed to |
Invisible coordinates of points on the ellipse
if(interactive()) {
plot.new()
plot.window(xlim=c(-1, 1), ylim=c(-1,1))
ellipseCols <- heat.colors(11)
ellipse(0, 0, a=1, b=0.5, alpha=0)
for(i in 1:11) {
ellipse(0, 0, a=1, b=0.5, alpha=degree2radian(i*15), col=ellipseCols[i])
}
ellipse(0, 0, a=1, b=1, col="black", lwd=2)
ellipse(0, 0, a=0.5, b=0.5, fill="steelblue")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.