4
$\begingroup$

This question already has an answer here:

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

$\endgroup$

marked as duplicate by MarcoB, m_goldberg plotting Oct 20 '17 at 15:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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

$\endgroup$
0
$\begingroup$
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

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.