Skip to content

Instantly share code, notes, and snippets.

@gtgrthrst
Created May 16, 2021 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtgrthrst/224f67c999ec73fcbc941229435d5b28 to your computer and use it in GitHub Desktop.
Save gtgrthrst/224f67c999ec73fcbc941229435d5b28 to your computer and use it in GitHub Desktop.
df <- data.frame(
group = c("A", "B", "C", "D"),
value = c(10, 15, 25, 50)
)
ggplot(df, aes(x="", y=value, fill=group))+
geom_bar(width = 1, stat = "identity") + theme_gray()+
coord_polar("y", start=0)+
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank()) + #刪除XY軸
guides(fill = FALSE, color = FALSE, linetype = FALSE, shape = FALSE) #刪除圖例
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment