facet标签可以"合并"还是合并?

时间:2018-04-11 13:32:04

标签: r ggplot2 facet

我在R中使用ggplot2包创建了一个堆积条形图。

ggplot(example_data, aes(x = ID, y = amount, fill = Taxa)) +
 geom_bar(stat="identity", position = "fill") +
 facet_grid(.~City+Car+Color , scales = "free_x", space = "free_x") +
 labs(y = "Relative Adbundance")+
 theme(axis.title.x = element_blank(),
       axis.ticks = element_blank(),
       axis.text.x = element_blank(),
       legend.position  = "none")

Stacked barplot

有没有办法简单地组合不同方面的部分?下图解释了我的意思。我想要一个灰色的酒吧说"米兰"对于目前称米兰的所有5个方面。我不想重复“#Milan; Milan"五次。所有其他圆圈组也是如此。这可能在ggplot2中吗?如果没有,有没有人知道解决方法?

Circled stacked barplot

0 个答案:

没有答案