Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: VectorColorFunction

  • To: mathgroup at
  • Subject: [mg124478] Re: VectorColorFunction
  • From: Dan <dflatin at>
  • Date: Sat, 21 Jan 2012 05:14:32 -0500 (EST)
  • Delivered-to:
  • References: <jfb3dr$hu0$>

On Jan 20, 2:00 am, Peter Rodenbach <peter.rodenb... at>
> Hi experts,
> I want to plot via ListVectorPlot a Field of Vectors. I obtained the
> vectors from a physics experiment. The Norm of all vectors is very
> similar, and what is important is its direction!
> Therefore, what I want to do now is: give each vector a color with a
> different direction a different color, e.g., up to 0.5degree red, 0.5
> to 1 degree yellow, etc.
> The Problem: The norm of each vector is used as argument for the
> function that determines the color, according to the help
> "With the setting VectorColorFunction->func, the arguments supplied to
> func are as follows" ,...., x,y,Subscript[v, x],Subscript[v,
> y],Norm[{Subscript[v, x],Subscript[v, y]}]"
> Does anyone have an idea for a workaround?
> Thanks
> Peter

One solution is to take the output of ListVectorPlot and with a
ReplaceAll and a Rule prepend each Arrow with a color, e.g.


Here I have a continous color function based on direction. It can be
easily modified to return one of a discrete set of colors based on
angle range.

-- Dan

  • Prev by Date: Re: VectorColorFunction
  • Next by Date: Re: Daylight savings time in DatePlus.
  • Previous by thread: Re: VectorColorFunction
  • Next by thread: Daylight savings time in DatePlus.