I'm trying to plot a vector field with vectors that displace 0.1 to the right. When I execute the code with the value xdis=0.1 I have for a result this:

enter image description here

The problem of this graph is that it doesn't show the displacement uniformly, contrary to the value xdis= 0.5 where it works perfectly:

enter image description here

I really fail to see where is the problem. Here I share the code I'm using. Any hint would be greatly appreciated!

ibigsize = {39, 39};

{xdis, ydis} = {0.1, 0.0};

origin[{x_, y_}] := {x - xdis, y - ydis};

tablepos = Table[{x, y},
   {y, Range[1, ibigsize[[2]], 1]}, 
   {x, Range[1, ibigsize[[1]], 1]}

tablev = Table[{x, y} - origin[{x, y}],
   {y, Range[1, ibigsize[[2]], 1]},
   {x, Range[1, ibigsize[[1]], 1]}

resreal = {tablepos, tablev};
resreal = Flatten[resreal, {{2}, {3}, {1}, {4}}];

 PlotLegends -> Automatic,
 VectorPoints -> All,
 VectorScaling -> Automatic,
 VectorSizes -> Small,
 VectorColorFunction -> Automatic
  • 1
    $\begingroup$ The culprit is: VectorScaling -> Automatic. I think this is a bug and should be reported to support@wolfram.com $\endgroup$ – Daniel Huber Feb 21 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.