MathGroup Archive 2007

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

Search the Archive

Re: ScaleFunction vs. ScaleFactor

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.

varray = Table[{Random[Real, {-0.7, 0.7}],
     Random[Real, {-0.7, 0.7}]}, {i, 10}, {j, 10}];
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.

  • 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)