Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: VectorColorFunction
Replies: 1   Last Post: Jan 21, 2012 5:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Patrick Scheibe

Posts: 327
Registered: 5/22/07
Re: VectorColorFunction
Posted: Jan 21, 2012 5:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

maybe I misunderstood you, but the parameters which you can use in a
VectorColorFunction are {x,y,fx,fy,norm}. Just use fx and fy to
calculate your angle and make a color from it:

VectorPlot[{x, y}, {x, -3, 3}, {y, -3, 3}, VectorColorFunction ->
Function[{x, y, fx, fy, norm}, ColorData["BrightBands"][
Mod[ArcTan[fx, fy], 2*Pi]/(2*Pi)]],
VectorColorFunctionScaling -> False]

Cheers
Patrick


On Fri, 2012-01-20 at 01:55 -0500, Peter Rodenbach wrote:
> 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
>







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.