'Avoid labels overlap in bar chart

How to avoid my y-axis label overlap in this case(top 5 most frequent words for each year)? Because I may need to change the number of words(ie.top10, top20) later, is there any way that the range of y-axis for each graph could be automatically adjusted based on the number of words that I want to analyze?

ggplot(dat2, aes(y = reorder_within(word, n, year),
                 x = n)) +
  geom_col() + 
  scale_y_reordered() +
  labs(title = "",
       x = "Word",
       y = "Count") +
  facet_wrap(~ year, scales = "free") +
  theme(text = element_text(size = 3)) +
  theme_minimal()

plot output



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source