# 加载 ggplot2 包 library(ggplot2) # 加载数据 data <- data.frame(category = c("A", "B", "C", "D"), value = c(10, 20, 30, 40)) # 绘制饼图 ggplot(data, aes(x = "", y = value, fill = category)) + geom_bar(width = 1, stat = "identity") + coord_polar("y", start = 0) + theme_void()
标签:绘制,library,data,ggplot2,数据,加载 From: https://www.cnblogs.com/biohujun/p/17110861.html