Create a new ggplot — ggplot • ggplot2

Restrict the length of axis tick labels placed on a single line

Code
starwars %>% 
  drop_na() %>% 
  ggplot(aes(hair_color, height, fill = hair_color)) +
  geom_col() +
  theme_nice() +
  scale_x_discrete(labels = scales::label_wrap(8))

Manually change the axis tick labels

Code
starwars %>% 
  drop_na() %>% 
  ggplot(aes(sex, height, color = sex)) +
  geom_point() +
  theme_nice() +
  scale_x_discrete(labels=c('F', 'M'))