I work in Genetics and very recently started practicing R, ggplot in particular, to make images for publication.
I run several analyses and combined in a single table (Attempt_mod_TopTen) 3 dataset containing:
- y axis (GO_term) = names that have to be in common for the entire graph
- x1 axis (N_Genes_AB) = numbers of genes associated with y, and their p_value
- X2 axis (N_Genes_A) = numbers of genes associated with y, and their p_value
- X3 axis (N_Genes_B) = numbers of genes associated with y, and their p_value
I am able to make a figure with single panel using only one set of data (either X1, X2, or X3)
library(ggplot2)
theme_set(
theme_bw()
)
ggplot(data = Attempt_mod_TopTen)+geom_point(aes(x=N_Genes_AB, y=GO_Term, size=P_value_AB)) +
scale_size(range = c(4,.2))
Bubble plot displaying the relation between the GO_terms, the number of genes and their P value:
I saw that there are posts on how to make bubble plot with multiple panels (i.e. facet_wrap), but I guess I am doing something wrong with my data because I can't find how to incorporate data for X2 and X3. I would like to display what I am able to make in a single panel in 3 panels next to each other that share the same y axis.