1
$\begingroup$

I'm using ListVectorPlot to draw vector fields. Is it possible to change the colors and also the types of the vectors?

$\endgroup$
  • 1
    $\begingroup$ You can find many things in the Documentation of Listvectorplot like VectorColorFunction and VectorStyle $\endgroup$ – J42161217 Oct 16 '18 at 7:47
2
$\begingroup$

You can use VectorMarkers to do this starting in V11.3:

data = Table[{-1 - x^2 + y, 1 + x - y^2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];
Row@Table[
    ListVectorPlot[data, 
        ImageSize -> 200, VectorPoints -> 8, PlotLabel -> s, 
        VectorStyle -> Red, VectorMarkers -> s
    ], 
    {s, {"Arrow", "Segment", "Drop", "Pointer", "Toothpick"}}
]

enter image description here

VectorMarkers has nice autocompletions:

enter image description here

There is also StreamMarkers for controlling the appearance of elements in stream plots.

$\endgroup$
1
$\begingroup$

You can use VectorStyle to specify both the glyph and color:

data = Table[{-1 - x^2 + y, 1 + x - y^2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];
Row @ Table[ListVectorPlot[data, ImageSize -> 200, VectorPoints -> 8, 
   PlotLabel -> s,  VectorStyle -> {s, Red}], 
 {s, {"Arrow", "Segment", "Drop",   "Pointer",  "Toothpick"}}]

enter image description here

$\endgroup$
  • $\begingroup$ .. afaik, this particular form of VectorStyle option setting does not appear in documentation. $\endgroup$ – kglr Oct 16 '18 at 8:25
  • 1
    $\begingroup$ I've reported the missing documentation to tech support at WRI. $\endgroup$ – murray Oct 16 '18 at 14:06

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.