Re: Plotting an Array of Vectors
- To: mathgroup at smc.vnet.net
- Subject: [mg124157] Re: Plotting an Array of Vectors
- From: "Brandon D. Batista" <bdbatista at gmail.com>
- Date: Wed, 11 Jan 2012 04:24:22 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201201101059.FAA27817@smc.vnet.net>
Hi Peter, As of Mathematica 7, vector visualization has become a standard feature. I will illustrate an example that I ran using Mathematica 8.0.4 based on your inquiry. To start you should enter your vector data into an array as you stated, and assign it to a variable. The following example is a 5 x 5 array: * data={{{3,3},{3,2},{3,4},{2,3},{1,4}},{{2,4},{4,3},{3,1},{2,1},{4,4}},{{1,2},{2,5},{5,1},{4,5},{3,5}},{{1,5},{5,3},{4,1},{5,2},{5,4}},{{1,6},{6,4},{3,6},{6,2},{6,6}}} * Your array would mimic this syntax. Then you would use the plot command ListVectorPlot[] with your chosen array variable name as the argument: * ListVectorPlot[data] * This should plot your vector field (using the default options for ListVectorPlot). Further customization is possible by adjusting these options during the ListVectorPlot function call. Hopefully this helps. Best, B. Batista On Tue, Jan 10, 2012 at 05:59, Peter Rodenbach < peter.rodenbach at googlemail.com> wrote: > Hi everyone. > > I wan to plot an 50 x 50 array that has two dimensional vectors in it > like > {{3,3},{3,2},{3,4},{2,3}.....},{{3,4},...},... > > in a way that it looks like a bunch of compass needles. (Remember that > High School experiment in which you visualise the magnetic field?) > > Thanks > > Peter > >
- References:
- Plotting an Array of Vectors
- From: Peter Rodenbach <peter.rodenbach@googlemail.com>
- Plotting an Array of Vectors