How can I plot multiple time series in 3D?

4

I'm a biochemist and I have a series of chromatograms, each taken after a different time of reaction (let's say after 10 min, 1 h, 2 h etc.). Now I want to visualize the change in the chromatogram by plotting my chromatograms behind each other in a three dimensional way (see picture). How can I do this? ListPlot3D is not giving me the desired result.

3D time series plot. In my case Y would be the elution time, Z the absorption and X would be the different times of reaction

Christian

Posted 2017-10-20T12:51:27.427

Reputation: 41

Question was closed 2017-10-20T15:26:37.870

1

Instead of using plotting functions, build it out of Line primitives. See here and related tutorials.

– Szabolcs – 2017-10-20T12:58:30.230

2

closely related: 84408

– kglr – 2017-10-20T13:36:33.007

Answers

2

Here's an example to get you started:

data = Table[{x, BesselJ[k, x]}, {k, 0, 5}, {x, 0, 20, 0.5}];

colorfun = ColorData[97];
lines = MapIndexed[
   Function[{coordList, index},
    With[{pts = Join[index, #] & /@ coordList},
     {colorfun@First[index], Line[pts], Point[pts]}
     ]
    ],
   data
   ];

Graphics3D[lines, BoxRatios -> {1, 1, 1/2},
 Boxed -> False, Axes -> True,
 FaceGrids -> {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}, 
 ViewPoint -> {2.2518533311697717`, 1.6729819979841525`, 1.89216484729015`}]

enter image description here

Szabolcs

Posted 2017-10-20T12:51:27.427

Reputation: 213 047

0

lineAssoc = 
  Association@
   Table[k -> Table[BesselJ[k, x], {x, 0, 20, 0.5}], {k, 0, 5}];
Clear[construct3DLineData];
construct3DLineData[linesAssoc_] := Module[{tmpLinesAssoc},
   tmpLinesAssoc = Transpose[{Range[Length@#], #}] & /@ linesAssoc;
   KeyValueMap[
    Transpose@Join[{ConstantArray[#1, Length@#2]}, Transpose[#2]] &, 
    tmpLinesAssoc]];
ClearAll[linePlot3d];
linePlot3d[linesAssoc_] := Module[{tmpData, tmpPlot},
   tmpData = construct3DLineData[linesAssoc];
   tmpPlot = 
    ListPointPlot3D[tmpData, 
     FaceGrids -> {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}];
   tmpPlot /. Point[a___] :> {Thick, Line[a]}];
linePlot3d[lineAssoc]

enter image description here

matheorem

Posted 2017-10-20T12:51:27.427

Reputation: 14 483