2
$\begingroup$

I am using the following code to make a 3D vector plot.

VectorPlot3D[{
  x (1 - x) - x*y,
  y (1 - y) + x*y - y*z,
  z (1 - z) + y*z},
 {x, 0, 1.2},
 {y, 0, 1.2},
 {z, 0, 1.2},
 Axes -> True, AxesLabel -> {"x", "y", "z"},
 VectorColorFunction -> "Rainbow",
 VectorScale -> {0.05, 0.7, None}]

This makes a bunch of vectors, but the entire vector is colored. Is there a way I can use VectorStyle or another option to make each vector have a black outline, but have the inside of the area filled in with the appropriate color?

$\endgroup$
8
$\begingroup$

You can use Graphics to define any shape for drawing the vectors. Something like this:

VectorPlot3D[{x (1 - x) - x*y, y (1 - y) + x*y - y*z, 
  z (1 - z) + y*z}, {x, 0, 1.2}, {y, 0, 1.2}, {z, 0, 1.2}, 
 Axes -> True, AxesLabel -> {"x", "y", "z"}, 
 VectorColorFunction -> "Rainbow", VectorPoints -> 5, VectorScale -> {0.03, .7, None}, 
 VectorStyle -> Graphics[{EdgeForm[Black], Rectangle[{-2, -.2}, {0, .2}], 
    Polygon[{{0, .5}, {Sqrt[3], 0}, {0, -.5}}]}]]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you! This is exactly how I wanted the plot to look! $\endgroup$ – jeanquilt Mar 22 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.