BUILT-IN MATHEMATICA SYMBOL

# VectorColorFunction

VectorColorFunction
is an option for VectorPlot and related functions which specifies a function to apply to determine colors of field vectors drawn.

## DetailsDetails

• The setting for VectorColorFunction is applied to the coordinates associated with the center of each field vector to determine the color to use to render the field vector.
• With the setting VectorColorFunction->func, the arguments supplied to func are as follows:
•  VectorPlot,ListVectorPlot, StreamPlot,ListStreamPlot, LineIntegralConvolutionPlot, ListLineIntegralConvolutionPlot x, y, , , Norm[{vx, vy}] VectorDensityPlot, ListVectorDensityPlot,StreamDensityPlot, ListStreamDensityPlot x, y, , , s VectorPlot3D,ListVectorPlot3D x, y, z, , , , Norm[{vx, vy, vz}]
• With the usual default setting , the arguments supplied to func are scaled to lie in the range 0 to 1.
• With original unscaled values are used.
• VectorColorFunction->"name" is equivalent to VectorColorFunction->(ColorData["name"][#i]&) where the slot used is as follows: VectorPlot, ListVectorPlot, etc.: (Norm[{vx, vy}]), VectorDensityPlot, ListVectorDensityPlot, etc.: (s), VectorPlot3D and ListVectorPlot3D: (Norm[{vx, vy, vz}]).
• The list of possible color function names is given by ColorData["Gradients"].
• The function specified by VectorColorFunction must return color directives such as RGBColor and Hue or named colors such as Red and Blue.
• It can also return Opacity, as well as Glow and Specularity.
• Combinations of directives can be specified using Directive[g1, g2, ...].

## ExamplesExamplesopen allclose all

### Basic Examples (2)Basic Examples (2)

Color the vectors according to their norm:

 Out[1]=

Use any color gradient from ColorData:

 Out[1]=