I have a data file that is the solution of the laplace equation on a rectangular area, which has three columns: x, y and z with their numerical values. How do I plot this data into a vector field with vectors in z direction with magnitude from the third column? When I import that data as "Table", is gives me a list of lists, i.e. {{x1,y1,z1},{},...,{}}, which makes it unsuitable to use with ListVectorPlot3D[]...


//edit I would like to use the imported data to interpret it as a vector field and calculate its rotation.

  • 1
    $\begingroup$ Shows us a sample of your data but my guess -- based on the format of the data in the functions examples -- is that you will need to use Partition. $\endgroup$ Jan 8, 2013 at 0:46
  • 1
    $\begingroup$ Here is a sample of the data: "0.100000 0.200000 9.793776". The values are in three columns separated by \t (without the quotation marks). What is very unclear to me is the input format ListVectorPlot3D needs and how I can Partition my data into something useful. $\endgroup$ Jan 8, 2013 at 7:09
  • 1
    $\begingroup$ To plot a vector, two points are required: its beginning and end. The data you have is likely the end point, so you need the starting points. Can you give us details about the grid you were using? From that, the starting points can be generated. $\endgroup$
    – rcollyer
    Jan 8, 2013 at 8:07
  • 1
    $\begingroup$ The vectors should be parallel to the z axis, so the first two coordinates would not change, whereas the last coordinate would be 0 for the starting point and the value for the end point. $\endgroup$ Jan 8, 2013 at 8:25

1 Answer 1


Probably the VectorPlot[] family isn't the best for the job:

data = Flatten[Table[{i, j, Norm[{i - 5, j - 5}]}, {i, 10}, {j, 10}], 1];
Graphics3D[{Green, Opacity[.3], Cuboid[{1, 1, 0}, {10, 10, 0}], 
            Black, Opacity[1] , data /. {x_, y_, z_} -> Arrow[{{x, y, 0}, {x, y, z}}]}]

Mathematica graphics

  • $\begingroup$ Although this generates exactly the kind of output I was looking for, I also want to use the vector field to calculate its rotation with Curl (I clarified that now in the question) $\endgroup$ Jan 8, 2013 at 7:18
  • 2
    $\begingroup$ @user That was such a substantial change that you should roll this question back to its original and post your modification as a new question. Please consider upvoting and accepting this reply, too, because you have acknowledged that it answers your original question. $\endgroup$
    – whuber
    Jan 8, 2013 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.