add vertical line ggplot2 code example Example: add a vertical line in ggplot + geom_vline(xintercept = 3, linetype="dotted", color = "blue", size=1.5)