# Animate a Vectorfield with VectorPlot3d , Scaling the Vectors

**URL:** <https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808>\
**Category:** Questions\
**Tags:** image-processing, physics, demonstrations, mathematica, import-and-export, computational-notebooks\
**Created:** [May 26, 2015, 12:14pm UTC](https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808 "2015-05-26T12:14:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patzold](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@patzold](https://community.wolfram.com/u/patzold)\
**Post date:** [May 26, 2015, 12:14pm UTC](https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808/1 "2015-05-26T12:14:13Z")

</div>

Hey there,

i want to animate the Variation of a Vectorfield by controlling the Parameter m.

So far this is what i got and it works

```
 f[x_, y_, z_, g_, m_,v_] := 
   {((x)^2 - m), x*y,x*z}*(g*v^2)/
     (2*(g^2*((x)^2 - m)^2 + (v*y)^2 + (v*z)^2)^(3/2));   
plots = 
  Table[
    Show[
      VectorPlot3D[
        f[x, y, z, 1, e, 1], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
        VectorColorFunction -> Hue]], 
    {e, -5, 5, 1}];
ListAnimate[plots];
Export["Test.gif", plots, ImageResolution -> 200]

```

The problem is the scaling of the Vectors. Mathematica scales them in each frame. You cannot compare 2 picture directly because the size is at a different scaling.

I want the size of the vectors, in every frame, relative to e.g. the biggest possible vector in the whole animation.  
I used VectorScale-\> but could not get it right.

Thank you for your Help and kind regards,  
max

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 26, 2015, 1:02pm UTC](https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808/2 "2015-05-26T13:02:32Z")

</div>

If you have a problem with scaling you must add “Plot range”.

```
f[x_, y_, z_, g_, m_, v_] :=
 {((x)^2 - m), x*y, x*z}*(g*v^2)/(2*(g^2*((x)^2 - m)^2 + (v*y)^2 + (v*z)^2)^(3/2));

 Animate[VectorPlot3D[f[x, y, z, 1, m, 1], {x, -5, 5}, {y, -5, 5}, {z, -5, 5},VectorColorFunction -> Hue, PlotRange -> 5], {m, -5, 5, 1},AnimationRunning -> False]

```

Export to Animation.

```
ANIM = Table[
   VectorPlot3D[
    f[x, y, z, 1, m, 1], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
    VectorColorFunction -> Hue, PlotRange -> 5], {m, -5, 5, 0.25}];
Export["Test.gif", ANIM, ImageResolution -> 200]

```

---

<div class="post-metadata">

**Author:** ![patzold](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@patzold](https://community.wolfram.com/u/patzold)\
**Post date:** [May 26, 2015, 2:53pm UTC](https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808/3 "2015-05-26T14:53:32Z")

</div>

This does not solve the Problem. The Problem is the different size of the vectors in each Frame.

But thank you for replying and trying to solve my problem !  
Best regards,  
max

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 28, 2015, 11:04am UTC](https://community.wolfram.com/t/animate-a-vectorfield-with-vectorplot3d-scaling-the-vectors/5808/4 "2015-05-28T11:04:41Z")

</div>

In Documentation Center is written:

> With the vector scaling function set to None, then all vectors have the same size.

```
Animate[VectorPlot3D[
 f[x, y, z, 1, m, 1], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
 VectorColorFunction -> Hue, PlotRange -> 5, 
 VectorScale -> {Small, Automatic, None}], {m, -5, 5, 0.5}, 
AnimationRunning -> False]

```

or

```
Animate[VectorPlot3D[
  f[x, y, z, 1, m, 1], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
  VectorColorFunction -> Hue, PlotRange -> 5, 
  VectorScale -> {Small, Small, None}], {m, -5, 5, 0.5}, 
 AnimationRunning -> False]

```

I hope it will help.
