Pie charts in ggplot2 with variable pie sizes

后端 未结 1 1883
傲寒
傲寒 2020-12-03 12:30

I\'ve tried various ways to get a facet_grid of pie charts in ggplot2 to vary width/radii according to another variable (strength).

geom_bar accepts wid

相关标签:
1条回答
  • 2020-12-03 12:59

    Do you mean like this?

    ggplot(mydata, aes(x=strength/2, y = val, fill = widget, width = strength)) +
      geom_bar(position="fill", stat="identity") + 
      facet_grid(side1 ~ side2) + 
      coord_polar("y") + 
      opts(axis.text.x = theme_blank()) 
    

    enter image description here

    0 讨论(0)
提交回复
热议问题