0

I have tried looking at examples and solutions for this. However, none of them seemed to work. My X-axis labels are overlapping on each other. Thus, I am unable to see which boxplot corresponds to which label. I am comparing gene expression in certain tissue types in different diseases (MND, OND, and NCC).

Here is the R script

my_comparisons <- list(c("MND", "NNC"),c("MND", "OND"),c("NNC", "OND"))
ggboxplot(subset(rips, !is.na(Tissue)), x = "Tissue", y = "ENST00000504942.6",
color = "Tissue", palette = "jco",
ylab = "Expression of ENST00000504942.6", xlab = "Tissue",
add = "jitter")
stat_compare_means(comparisons = my_comparisons)

And this is the output.

enter image description here

I appreciate your help!

Phil
  • 7,287
  • 3
  • 36
  • 66
Niki
  • 1
  • Please add a reproducible example https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – captcoma Nov 05 '21 at 11:12

2 Answers2

0

Here are a few suggestions. (1) change your labels (simply change the underlying data) (2) decrease the size of the labels (you can do that with + theme(axis.text.x = element_text(size = YOURSIZE))) (3) increase the size of the graph or (4) have it ordererd in a panel of two or more graphs like this since you labels are originally quite long.

Emile Tenezakis
  • 311
  • 3
  • 7
0

You could also change the angle of the x-axis text: theme(axis.text.x = element_text(angle = 90))

captcoma
  • 1,768
  • 13
  • 29