I'm trying to create a nicely formatted 2-state bump chart in GGPlot2
In the following plot I'd like to reduce the size of the 'white space' between the y axis and the first factor value "old" and increase the size of the space to the right of the second value "new". In the real data my text is full sentences so only the first part is currently being shown.
My code:
old <- data.frame(Group = "old", Rank = 1:5, Text = c("Text1","Text2","Text3","Text4","Text5"))
new <- data.frame(Group = "new", Rank = c(4,2,1,5,3), Text = c("Text1","Text2","Text3","Text4","Text5"))
df <- rbind(old,new)
library(ggplot2)
ggplot(df, aes(x=Group, y= Rank, group = Text, label = Text)) +
geom_line() +
scale_y_reverse() +
geom_text(data = subset(df, Group == "new"), size=3, hjust=0)