1
$\begingroup$

i was looking for a plot function which displays as function of Time/dates 2 series of different data, something like a ListPointPlot3D but for DateObject, which could be a DateListPlot3D function. Unfortunately i could not find such a function. is there something similar ?

$\endgroup$
2
  • 2
    $\begingroup$ Can you include a sample of the data you want to plot?\ $\endgroup$
    – MarcoB
    Jan 15 at 18:25
  • $\begingroup$ This is only an exampple: DateListX={DateObject1;DateObject2;DateObject3;DateObject4;DateObject5;DateObject6}; DataY={53.2,69.8,66.7,54.2,86.4,62.1}; DataZ={99.8,98.6,100.2,100.1,97.2,98.1}; the Data contains in reality more than 1000 points $\endgroup$
    – Pinco
    Jan 16 at 9:27
1
$\begingroup$
DateListX = DateRange[Today, DatePlus[Today, Quantity[5, "Days"]]]

enter image description here

DataY = {53.2, 69.8, 66.7, 54.2, 86.4, 62.1};
DataZ = {99.8, 98.6, 100.2, 100.1, 97.2, 98.1};

Construct {x, y, z} triples:

xyz = Transpose[{AbsoluteTime /@ DateListX, DataY, DataZ}];

Use the undocumented System`DateListPlotDump`DateTicks to get date ticks for the x axis:

xticks = System`DateListPlotDump`DateTicks[{##}, 9, 
   {"Month", "/", "Day", " ", "DayNameShort"}] &;

Plot using ListPointPlot3D:

ListPointPlot3D[xyz, ImageSize -> Large, Ticks -> {xticks, Automatic, Automatic}]

enter image description here

$\endgroup$
3
  • $\begingroup$ @kgir, thanks it works fine. Do you think a ToolTip on the single points (more than 1000) would be possible ? would it be extremely messy ? $\endgroup$
    – Pinco
    Jan 18 at 15:54
  • $\begingroup$ @Pinco, you can try ListPointPlot3D[ Tooltip[#, Flatten@{DateObject@#[[1]], #[[2 ;;]]}] & /@ xyz] $\endgroup$
    – kglr
    Jan 18 at 17:04
  • $\begingroup$ @kgir, i tried your suggestion but i get the error dimensions longer than data object $\endgroup$
    – Pinco
    Jan 19 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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