0
我有一个图形,我希望将另一图层添加到 Th图形在下面。我想叠加另一个极坐标图,看看数字“匹配”R ggplot2:向coord_polar添加另一个几何图形
在下面的示例中,我创建了一个虹膜数据集的物种的图。我想覆盖不同种类
感谢您的另一地块为您的时间
library(ggplot2)
library(dplyr)
mydf <- iris
plot.data <- tidyr::gather(mydf,key = attribute ,value = avg_score, Sepal.Length:Petal.Width)
plot.data <- plot.data %>%
filter(Species == 'setosa') %>%
group_by(attribute) %>%
summarise(attr_mean = mean(avg_score))
ggplot(plot.data, aes(x=attribute, y = attr_mean, col = attribute)) +
geom_bar(stat = "identity", fill = 'white') +
coord_polar(theta = "x") +
theme_bw()
太谢谢你了。这非常聪明 –