【发布时间】:2021-09-07 09:08:27
【问题描述】:
我想重现下面的堆叠直方图(来自 Armstrong A.,Microbiome,2018 年)。
情节本身没有问题,我可以用 PcoA 坐标来排序我的相对丰度。我的问题是我找不到通过一些临床数据(在此示例中为性取向和 HIV)标记每列/堆栈顶部的解决方案。这是用ggplot还是别的什么?如何绘制上面的行? 谢谢!
[编辑] 一些尝试的数据:
直方图(已由 PCoA 订购)
Pt Streptococcus Staphylococcus Lactobacillus Acinetobacter Pseudomonas Bacillus
patient1 61.20 5.65 7.45 1.65 0.30 0.60
patient6 43.00 2.10 18.10 0.40 0.60 0.60
patient5 41.95 4.10 24.55 0.75 0.90 0.00
patient8 41.15 25.95 3.50 0.20 7.45 0.30
patient4 26.45 55.10 2.55 3.40 0.05 2.85
patient7 18.20 26.40 0.95 20.25 0.50 0.05
patient3 18.00 18.70 38.55 0.10 56.55 0.00
patient2 0.35 0.05 2.10 0.20 0.40 94.75
要在顶部标记的元数据
Pt Time
patient1 T1
patient2 T3
patient3 T4
patient4 T2
patient5 T2
patient6 T1
patient7 T1
patient8 T2
【问题讨论】:
-
能否请您prepare an example dataset 以便人们可以用他们掌握的一些数据来回答您的问题?
-
你完全正确,对不起。我已经添加了一些,我希望它已经足够了(因为我不知道该怎么做我要求的......)
标签: r ggplot2 bar-chart data-manipulation stacked-chart