X axis at 45 degrees

Hi @ply you could get a better help if you put a reprex of you data. See this please,

# Example of df
set.seed(123)  # Seed for reproducibility of code
abcd <- data.frame(
  diameter = rnorm(100, mean = 10, sd = 2),
  sample = rep(letters[1:4], each = 25))

# boxplot with x axis 45 grades.
boxplot(abcd$diameter ~ abcd$sample, las = 2, cex.axis = 0.5, xlab = NA)

But I think that is better use ggplot2:

library(ggplot2)
ggplot(abcd, aes(x = sample, y = diameter)) +
  geom_boxplot() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) + # Set axis 45 grades
  labs(x = NULL)  

1 Like