# How to add arrows in the middle of the Plot-lines

If I got a bunch of numbers,then I can plot it with ListPlot:

{{1, 2}, {3, 9}, {7, 4}, {9, 9}}

ListPlot[%, Joined -> True]


Then I get

Now I would like to have arrows in the middle of these lines, like this:

Or maybe not in this way, but we got arrows in the end of each lines.

That's OK too.

If there is thousands of numbers like that, is there a simple way to add arrows like this?

Can anybody help me with that?

dt = {{1, 2}, {3, 9}, {7, 4}, {9, 9}};

Graphics[Arrow /@ Partition[dt, 2, 1], Frame -> Automatic]


Graphics[{Line @ dt, Arrow /@ Partition[dt, 2, 1] /.
{{a_, b_}, {c_, d_}} :> {{a, b}, {(a + c)/2, (b + d)/2}}},
Frame -> Automatic]


Edit thanks to @J.M.

The above result (arrowheads in the middle) can be obtained more easily with

Graphics[{Arrowheads[{{.05, 0.5}}], Arrow /@ Partition[dt, 2, 1]},Frame -> Automatic]

• You can use an Arrowheads[] specification to position the arrowheads in the middle of the segments. – J. M. will be back soon Oct 25 '15 at 14:06

Here is an interactive way you could place arrowheads,e.g second row could be copied and pasted into function once desired placement was achieved.

lst = {{1, 2}, {3, 9}, {7, 4}, {9, 9}};
Manipulate[
Column[{ListPlot[lst, Joined -> True] /.
Line[x__] :> {Arrowheads[ {{ah, ahp1}, {ah, ahp2}, {ah, ahp3}}],
Arrow[x]},
{{ah, ahp1}, {ah, ahp2}, {ah, ahp3}}
}]
, {ah, 0.05, 0.2}, {ahp1, 0, 1}, {ahp2, 0, 1}, {ahp3, 0, 1}]