I am making a graph in ggplot, and have rotated my x-axis labels 80 degrees. However, this caused my x-axis labels to no longer align with my x-axis tick marks (labels are a little too far to the right of tick marks). Can anyone help me shift x axis labels to the left? I have tried hjust and vjust, but both seem to make my axis labels move up and down rather than side to side...
The head of my data frame (called Data) looks like this:
Date Well Elev
1 2002-05-23 MW-3 929.04
2 2002-05-29 MW-3 929.39
3 2002-05-31 MW-3 929.37
4 2002-06-05 MW-3 929.36
5 2002-06-12 MW-3 NA
6 2002-06-13 MW-3 929.47
7 2002-06-19 MW-3 929.42
8 2002-06-26 MW-3 930.02
9 2002-07-05 MW-3 930.00
And my code looks like this:
ggplot(data= Data, aes(x = Date, y = Elev, group = Well, colour = Well)) +
geom_line(size = 0.75) +
xlab("") + ylab("Elevation (ft.)") +
scale_color_brewer(palette = "Spectral") +
scale_x_date(breaks = date_breaks("1 year"),
date_labels = ("%b %Y")) +
theme(axis.text.x = element_text(angle = 80, hjust = 1),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line( size=.1, color="gray"),
panel.grid.minor = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
panel.background = element_rect(fill = "white"))