r - Can I get coordinates of the circle created by `floating.pie` function in `plotrix`? -
i wondering how can x, , y values forming "circle" of pie chart produced "plotrix" package in r?
as example, how can x, , y values making "circle" of pie chart produced the r code below:
install.packages('plotrix') library("plotrix") plot(1:5, type="n", xlab="x", ylab="y",xpd=t) floating.pie(3, 3, 1, col="white", radius=1)
you can obtain on own using polar coordinates. , floating.pie
doing same.
let radius
, edges
, xpos
, ypos
same feed floating.pie
, circle determined following points:
radius <- 1; edges <- 200; xpos <- ypos <- 3 x <- radius * cos(seq(0, 2 * pi, length = edges)) + xpos y <- radius * sin(seq(0, 2 * pi, length = edges)) + ypos circle <- cbind(x, y) plot(1:5, asp = 1) ## set axis ratio 1:1 polygon(circle)
Comments
Post a Comment