# Problem with ListVectorPlot3D

I am trying to make a vector plot (3D or 2D) of the following list of 3 vectors. I simply failed to comprehend why I keep getting an error. Neither ListVectorPlot3D nor ListvectorPlot works.

Table[P2[[All, m, n]], {m, 1, 5}, {n, 1, 5}];
Dimensions[%]
ListVectorPlot3D[Table[P2[[All, m, n]], {m, 1, 5}, {n, 1, 5}]]

(* {5, 5, 3} *)


ListVectorPlot3D::vfldata: "{{{-0.686557,-0.686557,0},{-0.670429,-0.705715,0},{-0.652753,-0.725281,0},{-0.633417,-0.745197,0},{-0.612312,-0.76539,0}},<<3>>,{{-0.76539,-0.612312,0},<<3>>,{-0.699795,-0.699795,0}}} is not a valid vector field dataset or a valid list of datasets."

• What is P2? It will help to diagnose the problem if we know what its values are. Jul 1 '13 at 18:24
• Sorry, I should be much more informative. I have an array of 3-vectors on a 41x41 array (denoting the xy plane), creating a {3,41,41} matrix. I need to create a 3d (xyz) map of these vectors. I presume I need ListVector3D. But how do I covert my {3,41,41} to the requisite form? Jul 1 '13 at 21:21

If you use the first form of ListVectorPlot3D then your Dimensions should be {k,m,n,3} - a 3D array of 3D vectors. If you want the second form, then your dimensions should look {...,2,3} - a nD array of pairs of 3D vectors. Your {5,5,3} doesn't match any of these.

d1 = Table[{i, j, k}, {i, 1, 2}, {j, 1, 3}, {k, 1, 4}]; (* first form *)
d2 = Table[{{i, j, k}, {i, j, k}}, {i, 1, 2}, {j, 1, 3}, {k, 1, 4}]; (* second form *)
d3 = Flatten[d2, 2]; (* second form *)
Dimensions /@ {d1, d2, d3}
(* {{2, 3, 4, 3}, {2, 3, 4, 2, 3}, {24, 2, 3}} *)
Row[ ListVectorPlot3D /@ {d1, d2, d3}]


Also you should decide what you are visualizing a 3D field (with ListVectorPlot3D) or a 2D field (with ListVectorPlot).

Since all your points are effectively in one plane you will face the problem mentioned here. ListVectorPlot3D will try to interpolate and fail. You can try to draw a lot of Arrows instead:

arrows = Table[
Arrow[{{i, j, 0}, {i, j, i + j}}], {i, 1, 10}, {j, 1, 10}];
Graphics3D@arrows

• Sorry, I should be much more informative. I have an array of 3-vectors on a 41x41 array (denoting the xy plane), creating a {3,41,41} matrix. I need to create a 3d (xyz) map of these vectors. I presume I need ListVector3D. But how do I covert my {3,41,41} to the requisite form? Jul 1 '13 at 19:52
• @AnshumanPal, I edited the answer. Jul 1 '13 at 21:30