I have a ggplot which looks like this.
p2=ggplot(data=data1, aes(x=ID, y = value)) +
geom_line(group=1,color='steelblue', size=2) + facet_wrap(~variable)+theme_economist()
p2=p2+theme(text = element_text(size=10), axis.text.x = element_text(angle=90, hjust=1))
p2
The issue is that, I am getting overlapping X labels in the X axis. Is there any way to get non overlapping X axis labels.
There is nice solution to this problem with ggplot2 version 3.3.0.
scale_x_discrete(guide = guide_axis(n.dodge=3))
Here is an example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With