I would like to color gradient (Red to Blue) the following curve:
gr = Graphics[{Arrow[BezierCurve[{{0, 3}, {.8, 2}, {1.8, 1.7}}]]}]
Any help will be appreciated.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityGraphics[{Antialiasing -> True, Blue, AbsoluteThickness[2],
Arrowheads[.05],
Arrow[Line[BezierFunction[{{0, 3}, {.8, 2}, {1.8, 1.7}}] /@ Subdivide[100],
VertexColors -> (Blend[{Red, Blue}, #] & /@ Subdivide[100])]]}]
To get a smoother look Rasterize
using a large ImageSize
and resize using Magnify
:
Magnify[Rasterize[
Graphics[{Antialiasing -> True, Blue, AbsoluteThickness[20],
Arrowheads[.05],
Arrow[Line[BezierFunction[{{0, 3}, {.8, 2}, {1.8, 1.7}}] /@ Subdivide[100],
VertexColors -> (Blend[{Red, Blue}, #] & /@ Subdivide[100])]]}],
ImageSize -> 5000], .1]
Graphics[{Antialiasing -> True, Arrow[Line[ BezierFunction[{{0, 3}, {.8, 2}, {1.8, 1.7}}] /@ Subdivide[50], VertexColors -> (Blend[{Red, Blue}, #] & /@ Subdivide[50])]]}]
? $\endgroup$