draw.circle {plotrix} | R Documentation |
Draws a circle on an existing plot.
draw.circle(x,y,radius,nv=100,border=NULL,col=NA,lty=1,lwd=1)
x,y |
Coordinates of the center of the circle. |
radius |
Radius of the circle in user units. |
nv |
Number of vertices to draw the circle. |
border |
Color to use for drawing the circumference. |
col |
Color to use for filling the circle. |
lty |
Line type for the circumference. |
lwd |
Line width for the circumference. |
A list with the x and y coordinates of the points on the circumference.
The principal advantage of draw.circle is that it adjusts for the aspect ratio of the plot.
Jim Lemon
plot(1:5,seq(1,10,length=5),type="n",xlab="",ylab="",main="Test draw.circle") draw.circle(2,2,0.5,border="purple",lty=1,lwd=1) draw.circle(2.5,8,0.6,border="red",lty=3,lwd=3) draw.circle(4,3,0.7,border="green",lty=1,lwd=1) draw.circle(3.5,7,0.8,border="blue",lty=2,lwd=2)