Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing quarter of a circle in R

Tags:

r

I need to draw 90 degrees of a circle in r. I know how to draw a full circle in R with draw.circle but I don't know how to hide 270 degrees of it!

Thank you.

like image 263
SnowFrog Avatar asked Apr 29 '11 16:04

SnowFrog


2 Answers

You are using the package plotrix. Plotrix also has a function draw.arc.

library(plotrix)
?draw.arc
like image 179
Andrie Avatar answered Nov 19 '22 00:11

Andrie


You can also use the package grid, and the function grid.curve.

eg.

library(grid)
plot.new()
vp=viewport(x=0.5,y=0.5,width=1, height=1)
pushViewport(vp)

grid.curve(0.5,0.5,0.3,0.3, curvature=arcCurvature(90),square=F,ncp=10)
like image 44
user3246796 Avatar answered Nov 18 '22 23:11

user3246796