Line plot 3d

  • Thread starter button_ger
  • Start date
  • #1
10
0

Main Question or Discussion Point

Hey.

Is it possible to plot a line in 3D from one point to another?
The source of the points is a list.
 

Answers and Replies

  • #2
28,894
5,158
Yes.
 
  • #3
Hepth
Gold Member
448
39
List1 = {{1, 1, 1}, {3, 4, 5}};
List2 = {{-3, 1, 2}, {2, 1, 5}};
L3 = {Line[List1], Line[List2]}
Graphics3D[L3, Axes -> True,
PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}]
 
  • #4
10
0
Thank you.

I have a long list with points from an external file. How can i do this?
{{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1},...}

Every 2nd point should be the end-point of the line.
Or is it better to make it like this?
{{3,6,5,2,4,1},{3,5,4,6,7,4},{3,2,1,1,1,1},...}
 
Last edited:
  • #5
28,894
5,158
I have a long list with points from an external file. How can i do this?
{{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1},...}
If your long list of points is in a variable called dat (i.e. dat={{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1}}) then

Graphics3D[Line[Partition[dat,2]]]

will plot the lines
 
  • #6
10
0
great support in this forums.

Thanks a lot DaleSpam.


greets
button
 

Related Threads for: Line plot 3d

  • Last Post
Replies
4
Views
2K
Replies
7
Views
25K
Replies
0
Views
7K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
680
  • Last Post
Replies
10
Views
7K
  • Last Post
Replies
3
Views
4K
Top