MathGroup Archive 2000

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

Search the Archive

Re: 2D vector plot using ListPlotVectorField

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22724] Re: 2D vector plot using ListPlotVectorField
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 24 Mar 2000 03:27:06 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <8b9oln$9da@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

xia at oakland.edu wrote:
Hi,

Needs["Graphics`PlotField`"]

xdat = Flatten[Table[x*y^2, {y, -1, 1, 2/15}, {x, -1, 1, 2/15}]];
ydat = Flatten[Table[-x^2*y, {y, -1, 1, 2/15}, {x, -1, 1, 2/15}]];

xdat and ydat have 16 x 16 points and

ListPlotVectorField[Reverse[Partition[Transpose[{xdat, ydat}], 16]]]

we need a reverse because a matrix start in the left upper corner but
ListPlotVectorField[] expect it in the left lower corner.

ListPlotVectorField[] and PlotVectorField[] can use colors to display
the magnitude of the vector to color it but there is no way to set
the color form the data.

Hope that helps
  Jens


> 
> Hi,
> 
> I am very new in using Mathematica and would appreciate some helps in
> ListPlotVectorField and related topics.
> 
> I have three 2D text files of the same dimension: x.dat, y.dat, and w.dat.
> (each element in a row is separated by space, each row is ended by a
> return). I would like to use x.dat and y.dat as the components to draw a
> 2D map of line vectors, and would like to use w.dat to either control the
> width of the individual line vectors or the color of the individual line
> vectors.
> 
> By reading help files, I think that I should use
> ListPlotVectorField[list], where list is the ?two-dimensional array of
> vectors¹.  However, I could not find any information regarding the
> structure of this list. I appreciate if anyone knows
> 
> (1) any information regarding the structure of this list, and how to use
> ListPlotVectorField
> (2) any hints on how to use my third data file w.dat to control the width
> or color or the line vector map.
> 
> Thank you in advance.
> 
> Yang Xia
> xia at oakland.edu


  • Prev by Date: Re: Hydrogen atom modelling for P-Chem
  • Next by Date: Re: newby plotting question
  • Previous by thread: 2D vector plot using ListPlotVectorField
  • Next by thread: handicapping formula