简体   繁体   中英

How to make labels in boxplot vertical in R

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.

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))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM