MathGroup Archive 2007

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

Search the Archive

Re: ScaleFunction vs. ScaleFactor

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81572] Re: ScaleFunction vs. ScaleFactor
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 28 Sep 2007 02:08:16 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <fddfkq$a88$1@smc.vnet.net>

olalla wrote:

> I am using the ListPlotVectorField to plot a list of 2d-vectors 
> (vx,vy) at given points(x,y) but I'm in trouble with controling the  
> size of the head of the arrow and the relative size of the vectors. I  
> think that the problem is in the ScaleFunction and ScaleFactor  
> commands but I do not understand how to use them properly.

First, note that the functions ScaleFunction, MaxArrowLength, and 
ScaleFactor are applied in turn to the vectors in that order.

By default (value set to None or Automatic), ScaleFunction does nothing. 
If a user defined function is supplied, it is then applied to the whole 
set of vector. For instance, ScaleFunction -> (0.5 # &) tells 
Mathematica to divide the magnitude of every vector by two, whereas 
ScaleFunction -> (2 # &) doubles the magnitude of every vectors.

Then, MaxArroLength is applied. By default it does nothing to the set of 
vectors, but if the user provided a constant value, say 0.5, any vector 
with magnitude greater than this constant value will not be displayed.

Finally, ScaleFactor is applied to the remaining set of vectors. 
ScaleFactor resizes the vectors according to the constant value provided 
as parameter and it does so according to the vector of largest 
magnitude. That is, the largest magnitude is taken as being the unit 
length and all other  magnitudes are rescale according to it and the 
constant value provided by the user.

In other words, ScaleFunction is applied first and does an absolute 
scaling, then the remaining vectors are filtered according to the size 
of their magnitudes, and finally, ScaleFactor does a relative resizing.

Needs["Graphics`PlotField`"]
varray = Table[{Random[Real, {-0.7, 0.7}],
     Random[Real, {-0.7, 0.7}]}, {i, 10}, {j, 10}];
ListPlotVectorField[varray]
ListPlotVectorField[varray, ScaleFunction -> (0.5# &)];
ListPlotVectorField[varray, ScaleFunction -> (2# &)];
ListPlotVectorField[varray, MaxArrowLength -> 0.5];
ListPlotVectorField[varray, ScaleFactor -> 2];


I hope this is shedding more light on the subject than obscuring it.
-- 
Jean-Marc


  • Prev by Date: Fwd: Re: Re: Any Mathematica 6 book yet?
  • Next by Date: Re: create a list with x,y,z coordinates
  • Previous by thread: ScaleFunction vs. ScaleFactor
  • Next by thread: [Mathematica 6] Editing 3D graphics? (Editing tool for 2D only)