How to change x tick labels in R (move labels and change angle)
<p>To make my graph presentable I'm trying to move the tick labels on the x-axis. I'd like to move the labels, so the don't run into the graph and over the data. My current code for the graph is as follows:</p>

<pre><code> ggplot(Duffel_plotdat, aes(Afkorting, est)) + geom_point() + geom_errorbar(aes(ymin=est-se, ymax=est+se)) + labs(title="Variance loggers for each AHS") + xlab("Artificial hibernation structures") + ylab("Variance") +
scale_x_discrete(breaks=c("BL","BW","H","K","MB","MCD","WK"),
                 labels=c("Loose in brick", "In brick closed\nwith cotton wool", "Square\nceiling box", "Wall logger\ndirectly on wall", "Wall logger\non wooden cube", "Middle of\nCD-rack", "Wall plate box")) +
  theme(axis.text.x = element_text(angle=45))
</code></pre>

<p>Giving this graph: 
<img src="https://i.stack.imgur.com/wTqQ8.png" alt="Boxplot"></p>

<p>I found another question on this topic (<a href="https://stackoverflow.com/questions/12840129/change-the-position-move-of-tick-labels-when-plotting-with-matplotlib">change the position (move) of tick labels when plotting with matplotlib</a>) but since the figures are no longer available, I can't really determine if this helps me.</p>

<p>Finally I'd migth want to change the angle, so that the label names incline in the other way (diagonal from top left, to bottom right). I tried to do so using</p>

<pre><code>angle=135 
</code></pre>

<p>making the angle rigth, but putting the text upside down.</p>