easystats / see

:art: Visualisation toolbox for beautiful and publication-ready figures
https://easystats.github.io/see/
Other
874 stars 43 forks source link

Rotate x-axis labels by default for plot method for `check_outliers()` #317

Closed rempsyc closed 7 months ago

rempsyc commented 7 months ago

For the outliers paper, we have to add manual ggplot2 code to the plot method for check_outliers() so that the labels don't overlap. Reprex:

library(performance)
library(see)

x <- check_outliers(mtcars)
plot(x)


# Correction:
plot(x) + 
  ggplot2::theme(axis.text.x = ggplot2::element_text(
    angle = 45, size = 8
  ))

Created on 2024-01-24 with reprex v2.0.2

Would it make sense to make this the default?

Later on we can tackle #262 properly but for now that should be an improvement already?

IndrajeetPatil commented 7 months ago

Alternatively, we could use n.dodge argument and set it to 2.

rempsyc commented 7 months ago

Result for reference:

library(performance)
library(see)

x <- check_outliers(mtcars)
plot(x) + 
  ggplot2::guides(x = ggplot2::guide_axis(n.dodge = 2))

Created on 2024-01-24 with reprex v2.0.2

Yeah I think it could work too