ggeasy icon indicating copy to clipboard operation
ggeasy copied to clipboard

Set vjust in easy_rotate_x_labels()?

Open krlmlr opened this issue 5 years ago • 2 comments
trafficstars

The default vjust looks a bit awkward to me. I know I can set with #18, what's a good default?

library(tidyverse)

data <- tibble(a = 1:3)
data %>%
  ggplot(aes(a, a)) +
  geom_point() +
  ggeasy::easy_rotate_x_labels()


data %>%
  ggplot(aes(a, a)) +
  geom_point() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))

Created on 2020-07-05 by the reprex package (v0.3.0)

krlmlr avatar Jul 05 '20 16:07 krlmlr

I agree - centering looks good.

jonocarroll avatar Jul 06 '20 05:07 jonocarroll

As a default 0.5 makes sense, but vjust can be tricky on axis rotation when the tick text is wrapped. In such cases 0.5 doesn’t work well from past experience.

Related feature could be to justify text after rotation. When you have longer labels it looks weird since they are staggered due to the default justification to the left (down) if I remember correctly.

yonicd avatar Jul 06 '20 12:07 yonicd