I'm trying to increase the spacing of the labels on the y-axis in this barplot:
library(data.table)
ggplot(data, aes(y=values, x=categories)) +
geom_bar(stats="identity") +coord_flip()
The problem of course is that there are ~1500 y-axis categorical labels. At the moment, these are so squashed together one cannot see any trends in the data.
How can I increase spacing between these y-axis labels? Could I make the plot larger vertically?
Naturally one could decrease the text size or decrease the width of the bars, but this only works to a point...
I have tried the following solution with ?discrete_scale
:
ggplot(data, aes(y=values, x=categories))
+geom_bar(stats="identity") +coord_flip() + scale_x_discrete(expand = c(0,0.01))
However, fiddling with expand
doesn't appear to actually create space between these labels.