Mathematica Connecting Plot Points

Click For Summary
SUMMARY

To connect plot points in Mathematica, users must utilize the ListLinePlot function instead of the deprecated PlotJoined option in ListPlot starting from version 8. For 3D plotting, ListPlot3D does not support the PlotJoined option, which leads to errors when attempting to connect points in three-dimensional space. Instead, users should employ ListLinePlot for 2D connections and explore alternative methods for 3D visualizations. The discussion highlights the transition from older Mathematica versions to version 8 and the implications for plotting techniques.

PREREQUISITES
  • Familiarity with Mathematica version 8 or later
  • Understanding of 2D and 3D plotting functions in Mathematica
  • Knowledge of data structures in Mathematica, specifically lists of points
  • Basic experience with random number generation in Mathematica
NEXT STEPS
  • Learn how to use ListLinePlot for connecting points in 2D in Mathematica
  • Research alternative methods for 3D plotting in Mathematica
  • Explore the Accumulate function for generating cumulative data in Mathematica
  • Investigate the differences between ListPlot and ListPlot3D in Mathematica
USEFUL FOR

Mathematica users, data visualizers, and researchers needing to plot and connect multi-dimensional data points effectively.

brydustin
Messages
201
Reaction score
0
Given a set of points in a list how can you not only plot them (which I know how to do) but how can you connected a line between each successive pair of points.


i.e. { {Point1},{Point2},{Point3},...{PointN} } so that Point 1 has a straight line connecting to Point2, 2 to 3, 3 to 4,... K to K+1,..., and N-1 to N.

Where each point has x,y, and z "space" components.
 
Physics news on Phys.org
I meant how do I do this in 3-dimensions, your response was restricted to two-dimensions and it doesn't appear to work in three.

For example,
RandomWalk = RandomReal[{-1, 1}, {30, 3}];
ListPlot[Accumulate[RandomWalk],PlotJoined->True]
causes an error, whereas
RandomWalk = RandomReal[{-1, 1}, {30, 2}];
ListPlot3D[Accumulate[RandomWalk],PlotJoined->True]
does not.
Bill Simpson said:
In older versions of Mathematica

ListPlot[{{1,1},{2,2},{3,1}},PlotJoined->True]

In version 8 according to http://reference.wolfram.com/mathematica/ref/ListPlot.html there is no longer a PlotJoined option for ListPlot and they have apparently replaced this with a new function ListLinePlot

http://reference.wolfram.com/mathematica/tutorial/PlottingListsOfData.html
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 6 ·
Replies
6
Views
3K