我用下面的code画出了一个圆饼图
df <- data.frame(
variable = c('a', 'b', 'c', 'b'),
value = c(10,20,30,5)
)
p <- ggplot(df, aes(x = "", y = value, fill = variable))
p + geom_bar(width = 1, stat = "identity", position="fill") +
scale_fill_manual(values = c('red', 'blue', 'green', 'yellow')) +
coord_polar("y", start = 0) +
labs(title = "Pac man")
里面蓝色的区域有2个,有没有什么办法能够合并两个蓝色区域?
因为数据里面有很多这样的情况,谢谢!