Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8070
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail |
|---|---|
| From | Dan <dflatin@rcn.com> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: VectorColorFunction |
| Date | Sat, 21 Jan 2012 10:16:57 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <jfe3ap$9sr$1@smc.vnet.net> (permalink) |
| References | <jfb3dr$hu0$1@smc.vnet.net> |
| Lines | 37 |
| NNTP-Posting-Date | 21 Jan 2012 10:17:26 GMT |
| NNTP-Posting-Host | 6993c528.news.twtelecom.net |
| X-Trace | DXC=h@[[MQ12;mZ2?jHgl5=_;YC_A=>8kQj6]hHXa^^g6TZT3]nK>O\M4R_EFiONJ7[GoVJ@M7_W;Bf^X |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:8070 |
Show key headers only | View raw
On Jan 20, 2:00 am, Peter Rodenbach <peter.rodenb...@googlemail.com>
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
Another solution, using VectorColorFunction:
directionHue={x,y,vx,vy,n}\[Function]Hue[Rescale[ArcTan[vx,vy],{-\[Pi],
\[Pi]}]];
data=Table[{Sin[x],Cos[y]},{x,-2,2,0.1},{y,-2,2,0.1}];
ListVectorPlot[data,
VectorColorFunction->directionHue,
VectorColorFunctionScaling->False
]
-- Dan
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
VectorColorFunction Peter Rodenbach <peter.rodenbach@googlemail.com> - 2012-01-20 07:00 +0000 Re: VectorColorFunction Dan <dflatin@rcn.com> - 2012-01-21 10:16 +0000 Re: VectorColorFunction Dan <dflatin@rcn.com> - 2012-01-21 10:16 +0000
csiph-web