【发布时间】:2020-06-04 03:39:04
【问题描述】:
我正在用 ggplot2 绘制饼图,并成功地将百分比标签置于每个切片的中心
library(dplyr)
library(ggplot2)
library(ggpubr)
library("readxl")
df <- read_excel("Radiocomp.xlsx")
df$Pattern <- factor(cc$Pattern)
str(cc)
GGO <- ggplot(data=df, aes(x = "", y = GGO, fill = Pattern)) +
geom_bar(stat="identity", color = "white") +
geom_text(aes(label = paste0(GGO, "%")), position = position_stack(vjust = 0.5)) +
coord_polar("y") +
theme_void()
GGO
我尝试将百分比标签放在饼图之外以提高可读性
有什么推荐吗?
谢谢
【问题讨论】:
标签: ggplot2 pie-chart geom-text