Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get numerical output of ListSurfacePlot3D, i.e., a list of all the points, $(x,y,z)$ , used to construct the plot?

Thanks to your help I now have a list of (x,y,z). But the new mesh is irregular, I need z-values on specific (x,y). In more detail:

The original data ( is an array of 40 by 40, with

x = {0, 0.5, 1.0, ..., 19.5}

and the same for y.

Following user0501's suggestion the output is:

data = {{0., 8.73992, 14.8593}, {0., 8.38421, 15.075}, {0., 8.3125, 15.1281}, {0., 8.22328, 15.1943}, {0., 7.77126, 15.5292}, {0., 7.31923, 15.8642}, {0., 7.125, 16.0081},...}

How can I get the result based on the same regular grid as the grid based on the input data?

If you like, you can get the original data here:

data = Import[""];
surf = ListSurfacePlot3D[data, MaxPlotPoints -> 5]

Again, thanks a lot for your help!!


share|improve this question
up vote 11 down vote accepted

Is this what you are looking for?

p = ListSurfacePlot3D[Flatten[
       Table[{Cos[ϕ] Sin[θ], Sin[θ] Sin[ϕ], Cos[θ]}, {ϕ, -π, π, .2}, {θ, 0, π, .2}], 1]]
Graphics3D@Line@Cases[Normal[p], Line[x__] :> x, ∞]
 Point@Flatten[Cases[Normal[p], Line[x__] :> x, ∞], 1]

enter image description here enter image description here enter image description here

Flatten[Cases[Normal[p], Line[x__] :> x, ∞], 1]

should give you the list of x,y,z.

share|improve this answer
yes, this is exactly I was looking for. Thanks a lot, Harald – Harald Apr 19 '13 at 20:05
May I ask an additional question? – Harald Apr 21 '13 at 10:19
I'm not sure I understand your new question, but if you want to group the points, you can do something like SplitBy[data, {First, Part[#, 2] &}], if you want to sort, you can do something like SortBy[data, {First, Part[#, 2] &}]. – user0501 Apr 21 '13 at 14:24
I need the z-values of Flatten[Cases[Normal[p], Line[x__] :> x, ∞],1] at grid-positions at (0, 0), (0, 0.5),...(0, 19.5), (0.5, 0), (0.5, 0.5), (0.5, 1),..., (19.5, 19.5). So I wonder wether it would be possible to extract the data at these positions. Again, thanks for your effort, Harald – Harald Apr 21 '13 at 15:27
Can you put your code which generate data into the question? Since it's a surface plot, I guess I don't think you have z values on every point of the grid. – user0501 Apr 21 '13 at 15:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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