Home > Mobile >  How to make labels in boxplot vertical in R
How to make labels in boxplot vertical in R

Time:05-14

I have too many labels on the x-axis. How can I project them vertically? I can't find the right arguments...

   boxplot(df$y$x, data=df, drop = TRUE, main = "Boxplot y vs x", ylab="y", xlab="x")

Hopefully someone can help me out. Thanks in advance.

CodePudding user response:

Using ggplot2 you can do something like this

library(ggplot2)

ggplot(df)  
            geom_boxplot(aes(x = x,
                             y = y)) 
            ggtitle("Boxplot y vs x")  
            theme(axis.text.x = element_text(angle = 90))
  • Related