So I have this graph:
But I would like to add appropriate labels to the x axis so each column has a label. For this I used scale_x_discrete(limit = as.character(2008:2017))
however doing so gives this result:
As you can see the labels are all squashed to one side and the data bars to the other.
Am I doing something wrong? or is this bug?
Here is my code:
# First image
ggplot(data_melt, aes(x = year, y = value, fill = variable)) +
geom_bar(position = "fill", stat = "identity") +
theme(legend.position = "none")
# Second image
ggplot(data_melt, aes(x = year, y = value, fill = variable)) +
geom_bar(position = "fill", stat = "identity") +
theme(legend.position = "none") +
scale_x_discrete(limit = as.character(2008:2017))