Mathematica Spatial 3-D List Plot

  • Mathematica
  • Thread starter brydustin
  • Start date
  • #1
205
0
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?
.....
 

Answers and Replies

  • #2
Dale
Mentor
Insights Author
2020 Award
31,534
8,287
Assuming your list is stored in a variable named dat:

Graphics3D[Line[dat]]
 
  • #3
205
0
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.
 
  • #4
Dale
Mentor
Insights Author
2020 Award
31,534
8,287
I think they have examples in the online help for Line.
 
  • #5
205
0
I think they have examples in the online help for Line.

Specifically, I wanted to know how to have multiple different colored lines in a box, but what they show is how to have multiple sets of lines with different colors however not in the same box, their example:

l = Line[{{1, 1, -1}, {2, 2, 1}, {3, 3, -1}, {4, 4, 1}}];
{Graphics3D[{Dashed, l}], Graphics3D[{Pink, l}],
Graphics3D[{Thick, l}], Graphics3D[{Thick, Dashed, Pink, l}]}

Which makes four boxes, I want one box with 4 lines each with a different color, for example.
 

Related Threads on Mathematica Spatial 3-D List Plot

Replies
1
Views
3K
  • Last Post
Replies
2
Views
8K
  • Last Post
Replies
3
Views
14K
Replies
6
Views
4K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
882
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
1
Views
3K
Replies
2
Views
941
Top