# 3D List plot from a 2D array (Matrix)?

GROUPS:
 Hello, Let's assume I have something like this xcoor = Range[1, 2, 1/2]; ycoor = Range[3, 4, 1/2]; (x + y /. x -> xcoor) /. y -> ycoor These can be values of a 2D function (xcoor,ycoor) for given x and y coordinates. I can't use directly the function for plotting for IP reasons. I can only use the points that are evaluated at and I would like to have a plot looking like this data1 = Flatten[ Table[{r Cos[t], r Sin[t], 5 Sinc[r]}, {r, 0, 10, 0.5}, {t, -Pi, 3 Pi, 0.1}], 1]; data2 = ExampleData[{"Geometry3D", "Torus"}, "VertexData"]; ListPointPlot3D[data1] I could not find a way to do that, I was unable to convert that list to a table. I know there should be one. Thank you
1 year ago
6 Replies
 You can't 3Dplot your list because each point has 4 coordinates. Something is wrong with your question.
1 year ago
 Okay maybe I did not pose the question well enough. xcoor = Range[1, 2, 1/2]; ycoor = Range[3, 4, 1/2]; (x + y /. x -> xcoor) /. y -> ycoor I want to be able to plot the matrix as data point with respect to xcoor and ycoor. Each point in the matrix has corresponding coordinates. I can't use the function directly (in this example x+y) . I have to use the matrix values.
1 year ago
 Is this what you are looking for? coor = Tuples[{Range[1, 2, 1/2], Range[3, 4, 1/2]}]; ListPointPlot3D[ Partition[Thread[{coor, Total /@ coor}] // Flatten, 3]] 
 Hello Okkes,It is almost what I want here I added a line to your suggestion but there are still two issues. First if you look at the plot the ticks are wrong, I can't see the correct values that. xcoor = Range[1, 2, 1/20]; ycoor = Range[3, 4, 1/30]; vals = (x + y /. x -> xcoor) /. y -> ycoor; vals = Transpose[{Flatten[vals]}]; coor = Tuples[{xcoor, ycoor}]; ListPointPlot3D[Partition[Thread[{coor, vals}] // Flatten, 21]] Above is working but if I change to xcoor = Range[1, 2, 1/20]; ycoor = Range[3, 4, 1/30]; vals = (x + y /. x -> xcoor) /. y -> ycoor; vals = Transpose[{Flatten[vals]}]; coor = Tuples[{xcoor, ycoor}]; ListPointPlot3D[Partition[Thread[{coor, vals}] // Flatten, 21]] This is not going to work.
 Okkes Dulgerci 1 Vote I believe this is what you want. Replace 21 by 3. xcoor = Range[1, 2, 1/20]; ycoor = Range[3, 4, 1/30]; coor = Tuples[{xcoor, ycoor}]; points = Partition[Flatten@Thread[{coor, Total /@ coor}], 3]; ListPointPlot3D[points]