ggplot2: piecharts instead of points in an xy scatterplot

后端 未结 2 527
别跟我提以往
别跟我提以往 2021-01-15 11:24

I have a four-dimensional dataset, let\'s call the variables x, y, z and r. There is at most one entry for each combination of x and y. Currently, I have a scatterplot where

相关标签:
2条回答
  • 2021-01-15 12:06

    This does the trick:

    ggplot(aes(x=x,y=y)) + geom_point(aes(size=z)) + stat_spoke(aes(angle=r*2*pi, radius=3*z))

    0 讨论(0)
  • 2021-01-15 12:07

    You can use ggforce to realize the function, but someone has already done this for you, and created another R package called scatterpie, you can find it here

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