Mathematica Spatial 3-D List Plot

  • Context: Mathematica 
  • Thread starter Thread starter brydustin
  • Start date Start date
  • Tags Tags
    List Mathematica Plot
Click For Summary

Discussion Overview

The discussion revolves around plotting 3D points and connecting them with lines in Mathematica, specifically focusing on how to visualize a list of points in the form {x,y,z} and connect consecutive points. Participants explore methods for achieving this and inquire about customizing line colors for multiple datasets within a single graphic.

Discussion Character

  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant describes the challenge of plotting a list of 3D points and connecting them with lines, noting that standard functions like ListLinePlot and ListPlot3D do not meet their needs.
  • Another participant suggests using Graphics3D[Line[dat]] to plot the points and connect them with lines, assuming the data is stored in a variable named dat.
  • A participant expresses uncertainty about how to plot two datasets with different colors, asking for clarification on how to implement this in the same graphic.
  • Another participant references online help for examples related to the Line function but notes a specific limitation regarding plotting multiple colored lines in a single box.
  • One participant reiterates the issue of wanting to display multiple lines with different colors in a single graphic box, contrasting it with examples that produce separate boxes for each line color.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and approaches to the problem, with no consensus reached on the best method for plotting multiple colored lines in a single graphic box.

Contextual Notes

Participants have not fully resolved the issue of combining multiple colored lines in one graphic, and there are references to limitations in existing examples that do not address this specific need.

brydustin
Messages
201
Reaction score
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?
...
 
Physics news on Phys.org
Assuming your list is stored in a variable named dat:

Graphics3D[Line[dat]]
 
DaleSpam said:
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.
 
I think they have examples in the online help for Line.
 
DaleSpam said:
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K