I have a simple VectorPlot3D
VectorPlot3D[{x, y, z}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]
Can I substitute the default arrows with Graphics3D object like:
Graphics3D[Ellipsoid[{0, 0, 0}, {6, 2, 2}]]
?
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 communityYou can use the option VectorStyle
as follows:
VectorPlot3D[{z, y, z}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
VectorColorFunction -> Hue,
VectorPoints -> 3,
VectorStyle -> Graphics3D[Ellipsoid[{0, 0, 0}, {6, 2, 2}]],
VectorScale -> {Automatic, Scaled[0.05]},
ViewPoint -> {1.5, -2., 2.5}]
We can also use VectorStyle -> {{None, Graphics3D[Ellipsoid[{0, 0, 0}, {6, 2, 2}]]}}
to get the same picture. Using this form allows to assign different Graphics3D
objects to the two ends of the arrows. For example,
VectorPlot3D[{z, y, z}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
VectorColorFunction -> Hue,
VectorPoints -> 3,
VectorStyle ->
{{Graphics3D[Cuboid[-{1.5, 1.5, 1.5}, {1.5, 1.5, 1.5}]],
Graphics3D[Ellipsoid[{0, 0, 0}, {6, 2, 2}]]}},
VectorScale -> {Automatic, Scaled[0.05]},
ViewPoint -> {1.5, -2., 2.5}]
We can override the automatic styling of arrowheads using desired directives inside Graphics3D
(e.g., Graphics3D[{desiredStyle, desired3Dprimitive}]
). For example, using
VectorStyle -> {{Graphics3D[{Green, Cuboid[-{1.5, 1.5, 1.5}, {1.5, 1.5, 1.5}]}],
Graphics3D[Ellipsoid[{0, 0, 0}, {6, 2, 2}]]}}
gives
VectorMarkers
? You might be able to find a satisfactory built-in. $\endgroup$VectorPlot3D
? $\endgroup$VectorPlot3D[{x, y, z}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] /. Arrow[a_] :> yourNewGraphic[a]
. For instance, tryLine[a]
in that code. However, the problem withEllipsoid
is that it does not use coordinates the same way thatArrow
does, so you will have to do some math to determine the appropriate parameters. $\endgroup$