Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7726

Re: Plotting an Array of Vectors

From "Brandon D. Batista" <bdbatista@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Plotting an Array of Vectors
Date 2012-01-11 09:28 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jejkn2$bc0$1@smc.vnet.net> (permalink)
References <201201101059.FAA27817@smc.vnet.net>

Show all headers | View raw


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@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
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Plotting an Array of Vectors "Brandon D. Batista" <bdbatista@gmail.com> - 2012-01-11 09:28 +0000

csiph-web