I would like to reproduce the stacked histogram below (from Armstrong A., Microbiome, 2018).
The plot per se is no problem, I can order my relative abundances with PcoA coordinates. My issue is I can't find a solution for labelling the top of each column/stack by some clinical data (here in this example, sexual Orientation and HIV). Is this with ggplot or something else? How do I plot the rows above? Thank you!
[Edit] Some data for trying:
Histogram (already ordered by 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
Metadata to label on top
Pt Time
patient1 T1
patient2 T3
patient3 T4
patient4 T2
patient5 T2
patient6 T1
patient7 T1
patient8 T2