0

For example,

pie(1:3)

But the radius is constant.

How to make the pie plot which the radius is 1,2,3 respectively?

Feng Tian
  • 1,559
  • 1
  • 18
  • 27
  • So that every slice has a different radius according to its value? Or like this: http://stackoverflow.com/questions/8612920/pie-charts-in-ggplot2-with-variable-pie-sizes – Iris Oct 26 '15 at 10:43
  • @Iris No, I mean that different component have differents radius in the same figure. – Feng Tian Oct 26 '15 at 10:54

1 Answers1

2

Check radial.pie function in plotrix package

install.packages("plotrix")
library(plotrix)
radial.pie(c(1,2,3), labels=c("One", "Two", "Three"), radlab=TRUE)

would produce following figureenter image description here

discipulus
  • 2,665
  • 3
  • 34
  • 51
  • The radius does not fit to the numbers. How could you achieve that "one" has the radius 1, "two" has the radius 2 ....? @lovedynasty – Iris Oct 26 '15 at 12:28
  • From the figure above I see radius of green is 2 times radius of red and that of blue is exactly 3 times that of red. If you want to remove those labels 1, 1.5, 2 you can use show.grid.labels=FALSE option and if you wnat that two rings above red removed, you can use grid.col option to set it to your background. – discipulus Oct 26 '15 at 13:09
  • @lovedynasty It really make sense. But I have another question: In `radial.pie` how to control the absolute radius? You know, `radial.pie(1:3)` and `radial.pie(c(2,4,6))` will be the same. Could I reduce the size of the former? – Feng Tian Oct 26 '15 at 15:52
  • @FengTian : I am not sure if that is a desirable feature, but in any case that feature does not seem to be available in `radial.pie` as of now. As the author says he is willing to listen to feedback and improve, may be it is worth giving him this feedback. – discipulus Oct 27 '15 at 11:24