Code suggestions:
a) use theme_set() to both define a theme and set a base size for all relevant parts (axis, theme, labels) in a single command, that saves the multiple arguments in theme().
b) rotate x-axis labels with guides rather than angle as guides ensures proper alignment in horizontal and vertical directions even using angles such as 45°, see here, and
c) put legend on top so its large size does not shrink the plot itself. Again, the sizes of all fonts and labels are auto-adjusted to look decent based on the base_size in the theme_set() command on top.
theme_set(theme_bw(base_size = 15))
df %>%
pivot_longer(everything(),names_to = "cels", values_to ="vals") %>%
inner_join(., rownames_to_column(pdata),by = c("cels" = "rowname")) %>%
ggplot(., aes(cels,vals, fill=Sensitivity)) +
geom_boxplot()+
facet_wrap(~IVT, scales = "free")+
xlab("")+
ylab("")+
guides(x = guide_axis(angle = 45))+
theme(legend.position="top")
By the way, the code example you use requires the arrays package to be installed to have access to their extdata, BiocManager::install("arrays").
in the absence of data, i suggest following:
Instead of boxplot, consider using violin plot with jitter.
Thank you for your response. I have edited to repost the data. Could you now let me know where am i going wrong