Reputation: 6874
This should be simple but I can't find the answer. All I want to do is add a line to a plot drawn at a specific y value starting at a specific x value and ending at a specific x value. The abline function doesn't seem to have a start and end parameter. How do I do this in r for normal (non ggplot) plots
Upvotes: 0
Views: 938
Reputation: 5272
In a general case, to plot a line from point (x_1, y_1)
to point (x_2, y_2)
, simply use lines(c(x_1, x_2), c(y_1, y_2))
Upvotes: 1