Entering edit mode
14 months ago
odi
▴
10
I will like to create a plot similar to that attached below:
This is my code but I am having problems with the go description/category being a lot so had to look at the graph and I don't know how to do the titles as in the picture. Please help. Here is the code I have:
enrichment_overexpress_results %>%
mutate(ontology = factor(ontology, levels = c("CC", "MF", "BP"))) %>%
arrange(ontology) %>%
ggplot(aes(x = fct_inorder(Description), y = log_pvalue, fill = fct_rev(ontology)))+
geom_bar(stat = "identity", position = "dodge") +
coord_flip() +
xlab("Description") +
ylab("-log Pvalue") +
guides(fill = guide_legend(title = "ontology"))
The go category needs to be a facet on the ggplot.