Plots.jl: can we connect two points in a D-2 plot with a straight line?

Suppose I have a D-2 plot produced by Plots.jl, which may display a time series or a mere parabola. Is it possible to connect two points with a straight line by using annotations or any other Plots’ functionality? I am not considering vline or hline, both of which I know how to manipulate. For example, connecting points (1,2) and (3,4).

Of course, I can always edit a posteriori the plot’s pdf file, but this is not the best option, for obvious reasons.

Help would be appreciated.

How about plot!([1, 3], [2, 4])?

@josuagrw Ha, ha. It couldn’t be easier, could it? Thank you very much. It is quite hilarious when we try so many sophisticated approaches to solve a problem when the solution is so intuitive and straightforward.

Thank’s a lot.

2 Likes