Let's consider the following case

f[x_] := x^2;
data = Table[{x, f[x]}, {x, -10, 10, 0.1}];
p0 = ListPlot[data, Frame -> True, Axes -> False, Joined -> True,
PlotStyle -> {Blue, Thick}]

In reality my data sets correspond to closed curves (loops), for which however the analytic equation is unknown. So, the solution should not take for granted that we know the exact mathematical expression.

Now I would like to add arrows inside the curve (which is produced by joining the points) thus showing the direction (from left to right), like this

Any suggestions?

• Well is a closed loop the arrows can show you if the motion along the curve is clockwise or counterclockwise. The "left to right" notation is only for this simple example! Sep 28, 2014 at 15:12
• very closely related Sep 28, 2014 at 15:13

ClearAll[f, x, data];
f[x_] := x^2;
data = Table[{x, f[x]}, {x, -10, 10, 0.1}];
p0 = ListPlot[data, Frame -> True, Axes -> False, Joined -> True,
PlotStyle -> {Blue, Thick}];

p0 /. Line[x_] :> {Arrowheads[Table[.05, {5}]], Arrow[x]}

p0 /. Line[x_] :> {Arrowheads[{0, .05, .05, 0}], Arrow[x]}

or

Show[p0, BaseStyle -> Arrowheads[{0, .05, .05, 0}]] /. Line -> Arrow
(* same picture *)

You can also set the Arrowheads directive as part of the PlotStyle option:

ListPlot[data, Joined -> True, Frame -> True, Axes -> False,
PlotStyle -> {Blue, Thick, Arrowheads[{0, .05, .05, 0}]}] /.  Line -> Arrow

or, as the setting for BaseStyle

ListPlot[data, Joined -> True, Frame -> True, Axes -> False,
BaseStyle -> Arrowheads[{0, .05, .05, 0}], PlotStyle -> {Blue, Thick}] /. Line -> Arrow
• What if I want only two as in the above plot? You use arrowheads but I don't want the am the start and end of the curve. Sep 28, 2014 at 15:17
• @Vaggelis_Z, you can use Arrowheads[{0, .05, .05, 0}].
– kglr
Sep 28, 2014 at 15:23
• @kglr Hi, kglr. Why the arrows are not evenly distributed? You can try p0 /. Line[x_] :> {Arrowheads[Table[.05, {30}]], Arrow[x]} Jul 13, 2016 at 3:21
• @matheorem, good observation. I don't know why off the top of my head. This looks like a good question to post.
– kglr
Jul 13, 2016 at 7:25