# Mathematica Spatial 3-D List Plot

• Mathematica
I want to plot a list of points where each element is of the form {x,y,z} so that the list is like:

{ {x1,y1,z1} , {x2,y2,z2} , .... , {xN,yN,zN} }.

And I want to connect a line between each consectutive pair (i.e. {x(i-1),y(i-1),z(i-1)} & {x(i),y(i),z(i)} ).

Unfortunately, its not as simple as ListLinePlot[List, Joined -> True], what this will do is take each {x(j),y(j),z(j)} and plot them each as separate lines each with 3 points in 2-D space.

Also, its not as simple as ListPlot3D[List, Joined -> True]
Because the Joined function is not defined in 3-D. But surely there is a way around this?
.....

Dale
Mentor
2020 Award
Assuming your list is stored in a variable named dat:

Graphics3D[Line[dat]]

Assuming your list is stored in a variable named dat:

Graphics3D[Line[dat]]

Now that I know the name of the function, I'm not sure how I might plot two sets of data, like dat1 and dat2 where the lines are color1 and color2, for example.

Dale
Mentor
2020 Award