0

I am making a graph using ggplot however my x-axis labels are overlapping.

see both graphs here: https://i.stack.imgur.com/Za8gA.jpg

enter image description here

enter image description here

I have looked online and found out that changing the width through save as image option seems to do the job however this stretches my graph a lot horizontally. Is there a way to prevent x axis labels from overlapping without tremendously stretching out my graph?

OzanStats
  • 2,756
  • 1
  • 13
  • 26
potatopainting
  • 103
  • 1
  • 9
  • Check out ggrepel() @yiyle – mnm Jul 07 '18 at 03:50
  • 1
    How about using `coord_flip()` to make a horizontal plot instead? Or you can set `theme(axis.text.x = element_text(size = 13, angle = 90, hjust = 1.0, vjust = 0.5))` to rotate x-axis label 90 degree – Tung Jul 07 '18 at 04:41
  • 1
    Also please share sample of your data using `dput()` (not `str` or `head` or picture/screenshot) so others can help. See more here https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?rq=1 – Tung Jul 07 '18 at 04:42

0 Answers0