Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color Plot by order of points in list - Mathematica

I've got a list of three dimensional points, ordered by time. Is there a way to plot the points so that I can get a visual representation that also includes information on where in the list the point occurred? My initial thought is to find a way to color the points by the order in which they were plotted.

ListPlot3D drapes a sheet over the points, with no regard to the order which they were plotted.

ListPointPlot just shows the points, but gives no indication as to the order in which they were plotted. It's here that I am thinking of coloring the points according to the order in which they appear in the list.

ListLinePlot doesn't seem to have a 3D cousin, unlike a lot of the other plotting functions.

like image 463
Alec Avatar asked Aug 19 '11 21:08

Alec


People also ask

What is Epilog in Mathematica?

Epilog. Cell[BoxData["Epilog"], "Input", CellTags -> "Epilog_templates"] is an option for graphics functions that gives a list of graphics primitives to be rendered after the main part of the graphics is rendered.

How do you give a plot a color?

The usual way to set the line color in matplotlib is to specify it in the plot command. This can either be done by a string after the data, e.g. "r-" for a red line, or by explicitely stating the color argument. See also the plot command's documentation.


1 Answers

You could also do something like

lst = RandomReal[{0, 3}, {20, 3}];
Graphics3D[{Thickness[0.005], 
  Line[lst, 
   VertexColors -> 
    Table[ColorData["BlueGreenYellow"][i], {i, 
      Rescale[Range[Length[lst]]]}]]}]

line with gradient

like image 98
Heike Avatar answered Sep 18 '22 22:09

Heike