# How can I plot multiple time series in 3D? [duplicate]

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.

## marked as duplicate by MarcoB, m_goldberg plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 20 '17 at 15:26

• Instead of using plotting functions, build it out of Line primitives. See here and related tutorials. – Szabolcs Oct 20 '17 at 12:58
• closely related: 84408 – kglr Oct 20 '17 at 13:36

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}]


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]
`