Arrow head halfway along parametric plot
The real problem your are having is the way GraphicsComplex
uses VertexColors
. In short, your parametric plot with colors produces something like this
Graphics[GraphicsComplex[{{0, 0}, {1, 1}, {2, 1}},
{Line[{1, 2, 3}, VertexColors -> Automatic]},
VertexColors -> {Yellow, Blue, Green}
]]
Note that at the end of Line
it says VertexColors -> Automatic
which states that it uses the vertex color definition that is given at the end of GraphicsComplex
.
Just replacing Line
with Arrow
will therefore not work and you will get an error message because Arrow
does not take a VertexColors
option.
In fact, Arrow
cannot be used with VertexColors
at all. Fortunately, Arrow
cannot take only points as arguments, but Lines
primitives itself. Therefore, one solution to your problem is
p0 = ParametricPlot[{t, t^2}, {t, 0, 1}, PlotStyle -> Thick,
PlotRange -> {{-0.8, 0.8}, {-0.8, 0.8}},
ColorFunction -> Function[{x, y, t}, Hue[0.7*t]], Frame -> True,
FrameLabel -> {{"y/\[Lambda]", None}, {"x/\[Lambda]",
HoldForm["f" = Fi]}},
GridLines -> {{0.4, 0, -0.4}, {-0.4, 0, 0.4}},
FrameTicksStyle -> Thick,
FrameTicks -> {{{-0.8, -0.4, 0, 0.4, 0.8},
None}, {{-0.8, -0.4, 0, 0.4, 0.8}, None}},
GridLinesStyle -> Opacity[0.5], Axes -> False, ImageSize -> 300,
PlotRangePadding -> None, BaseStyle -> {FontSize -> 18},
AspectRatio -> Automatic]
p0 /. l_Line :> {Arrowheads[{0, 0.1, 0}], Arrow[l]}
In the absence of definitions for x
, y
, and pt
, set
x = t^2; y = t^3;
and replace p[[1]]
by 1
for specificity. Then an arrow is obtained by replacing the last line of the code by
(p0 // Normal) /. Line[x_] :> {Arrowheads[{0, 0.1, 0}], Arrow[x]}
Normal
is needed to convert GraphicsComplex
to Line
.