Hi everyone,
I used the following command for visualizing microbiome relative abundance
ggplot(mdata_class, aes(x = Sample.ID, y = Abundance, fill = Class)) +
geom_bar(stat = "identity") +
scale_fill_manual(values = class_colors) +
scale_x_discrete(
breaks = map$Sample.ID,
labels = map$Sample.ID,
drop = FALSE
) +
theme(axis.title.x = element_blank(),
axis.text.x=element_text(angle=90,hjust=1,vjust=0.5)) +
guides(fill = guide_legend(reverse = TRUE, keywidth = 1, keyheight = 1)) +
facet_grid(~Health.state) +
ylab("Relative Abundance (Class > 1%) \n") +
ggtitle("Class Composition of microbiome data per individual")
facet_grid was used to separate samples to each category based on health status, however, the bar plot resulted from the command looks like:
my question
How to make the bar plot for each category (healthy or patient) include only its samples?
thank u in advance