4
$\begingroup$

I want to combine a TimeLinePlot and a DataListPlot. For both I use the same periode. The problem is that both X-axis differ when I make a overlay.

There are two datasets. The first one is about events to create a timeline:

events2017 = {{DateObject[{2017, 1, 3}, "Day", "Gregorian",     2.`], {"Tuesday  ", "event1"}}, {DateObject[{2017, 1, 17}, "Day",     "Gregorian", 2.`], {"Tuesday",     "event2"}}, {DateObject[{2017, 2, 10}, "Day", "Gregorian", 
2.`], {"Friday", "event3"}}, {DateObject[{2017, 2, 14}, "Day",     "Gregorian", 2.`], {"Tuesday",     "event4"}}, {DateObject[{2017, 2, 16}, "Day", "Gregorian",     2.`], {"Thursday ", "event5"}}, {DateObject[{2017, 2, 17}, "Day",     "Gregorian", 2.`], {"Friday",     "event6"}}, {DateObject[{2017, 2, 21}, "Day", "Gregorian",     2.`], {"Tuesday  ", "event7"}}, {DateObject[{2017, 3, 8}, "Day",     "Gregorian", 2.`], {"Wednesday",     "event8"}}, {DateObject[{2017, 3, 24}, "Day", "Gregorian",     2.`], {"Friday", "event9"}}, {DateObject[{2017, 3, 27}, "Day",     "Gregorian", 2.`], {"Monday",     "event10"}}, {DateObject[{2017, 3, 28}, "Day", "Gregorian",     2.`], {"Tuesday", "event11"}}, {DateObject[{2017, 4, 6}, "Day",     "Gregorian", 2.`], {"Thursday",     "event12"}}, {DateObject[{2017, 4, 7}, "Day", "Gregorian", 
2.`], {"Friday", "event13"}}, {DateObject[{2017, 4, 24}, "Day",     "Gregorian", 2.`], {"Monday",     "event14"}}, {DateObject[{2017, 4, 26}, "Day", "Gregorian",     2.`], {"Wednesday", "event15"}}, {DateObject[{2017, 5, 5}, "Day",     "Gregorian", 2.`], {"Friday",     "event16"}}, {DateObject[{2017, 5, 11}, "Day", "Gregorian",     2.`], {"Thursday", "event17"}}, {DateObject[{2017, 5, 16}, "Day",     "Gregorian", 2.`], {"Tuesday  ",     "event18"}}, {DateObject[{2017, 5, 22}, "Day", "Gregorian",     2.`], {"Monday", "event19"}}, {DateObject[{2017, 5, 24}, "Day",     "Gregorian", 2.`], {"Wednesday", "event20"}}
};

events2017tl = 
 TimelinePlot[
  MapThread[Labeled, {events2017[[All, 1]], events2017[[All, 2]]}], 
  ImageSize -> 1000]

enter image description here The second data sets is about the number of visitors at a specific day.(There ar no visitors in the weekend)

Visitors = {{DateObject[{2017, 1, 2, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    21}, {DateObject[{2017, 1, 3, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 4, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 5, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 6, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 9, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 10, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 11, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 12, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 13, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 1, 16, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 17, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 18, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 19, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 20, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 23, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 24, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    21}, {DateObject[{2017, 1, 25, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 26, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 27, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 1, 30, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 1, 31, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 1, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 2, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 3, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 6, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 7, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 8, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 9, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 10, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 13, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 14, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 15, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 16, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 2, 17, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 20, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 21, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 2, 22, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    22}, {DateObject[{2017, 2, 23, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 2, 24, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    21}, {DateObject[{2017, 2, 27, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 21}, {DateObject[{2017, 2, 28, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 3, 1, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 3, 2, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 3, 3, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 6, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 7, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 8, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 9, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 24}, {DateObject[{2017, 3, 10, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 3, 13, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    24}, {DateObject[{2017, 3, 14, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 15, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 3, 16, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 24}, {DateObject[{2017, 3, 17, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 3, 20, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 21, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 22, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 23, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 24, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 27, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 28, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 3, 29, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 3, 30, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    23}, {DateObject[{2017, 3, 31, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 4, 3, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 4, 4, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 4, 5, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 4, 6, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 4, 7, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 4, 10, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 4, 11, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 4, 12, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 4, 13, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 4, 14, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 4, 17, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 4, 18, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    22}, {DateObject[{2017, 4, 19, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 4, 20, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    22}, {DateObject[{2017, 4, 21, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 4, 24, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 4, 25, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 24}, {DateObject[{2017, 4, 26, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 4, 27, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 24}, {DateObject[{2017, 4, 28, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 5, 1, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 25}, {DateObject[{2017, 5, 2, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    25}, {DateObject[{2017, 5, 3, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 25}, {DateObject[{2017, 5, 4, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    25}, {DateObject[{2017, 5, 5, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    26}, {DateObject[{2017, 5, 8, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 25}, {DateObject[{2017, 5, 9, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    25}, {DateObject[{2017, 5, 10, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 25}, {DateObject[{2017, 5, 11, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    25}, {DateObject[{2017, 5, 12, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 25}, {DateObject[{2017, 5, 15, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 5, 16, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 24}, {DateObject[{2017, 5, 17, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 5, 18, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 5, 19, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    24}, {DateObject[{2017, 5, 22, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 5, 23, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 5, 24, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    24}, {DateObject[{2017, 5, 25, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 5, 26, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 5, 29, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 5, 30, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 5, 31, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 6, 1, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 6, 2, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 6, 5, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 6, 6, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 22}, {DateObject[{2017, 6, 7, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 6, 8, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}, {DateObject[{2017, 6, 9, 0, 0, 0.`}, "Instant",     "Gregorian", 2.`],    23}, {DateObject[{2017, 6, 12, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`],    23}, {DateObject[{2017, 6, 13, 0, 0, 0.`}, "Instant", "Gregorian", 
2.`], 23}
};

The dataset look like

vistotorsdlp = DateListPlot[vistotors, ImageSize -> 1000]

enter image description here

Then I combine both plots using:

Overlay[{vistotorsdlp, events2017tl}, Alignment -> Bottom]

As you can see, the x-axes of both plots are different. My goal is to create one plot with the same x-axes. Who has a suggestion?

enter image description here

$\endgroup$
2
  • 2
    $\begingroup$ You have definitely different time ranges in both datasets and, therefore, different boundaries of the x-axis. Did you try the manual definition of the same PlotRange for both plots? Let's say, 01.01.17 - 15.06.17? $\endgroup$
    – Rom38
    Commented Aug 18, 2017 at 8:23
  • $\begingroup$ possible duplicate: TimeLinePlot: change the y-axes ranges? See if this answer gives you what you need. $\endgroup$
    – kglr
    Commented Mar 31, 2020 at 21:56

2 Answers 2

2
$\begingroup$

╮(╯▽╰)╭

events2017tl = TimelinePlot[ MapThread[Labeled, {events2017[[All, 1]], events2017[[All, 2]]}],  ImageSize -> 1000, PlotRange -> {{2017, 1, 2}, {2017, 6, 13}}];
vistotorsdlp = DateListPlot[{#1, 4.5 (#2 - 21)} & @@@ Visitors, ImageSize -> 1000, PlotStyle -> {Purple}];
Framed[Show[{events2017tl, vistotorsdlp}]]
$\endgroup$
1
  • $\begingroup$ Do you have a suggestion how to visualize the original y-axes from the datalistplot? $\endgroup$ Commented Aug 22, 2017 at 6:47
0
$\begingroup$

I had a similar problem but got an answer in the Wolfram Community. The critical point is in TimelinePlot must added spacings parameter to adjust the spacing of the graph. But this method does not seem to work in other situations ~~~ This is troublesome for me. Don't know if anyone can provide other suggestions?

data1 = {22.649, 20.2489, 15.3239, 16.038, 19.275, 17.679, 17.440, 
   19.152, 20.991, 18.8512, 17.674, 19.195, 19.464, 18.530, 18.033, 
   18.409, 19.077, 16.760, 16.798, 17.721, 18.308, 17.397, 19.276, 
   20.567, 19.388, 19.460};
data2 = {8.641, 7.911, 7.713, 9.248, 11.588, 10.251, 7.973, 8.245, 
   8.517, 8.777, 10.114, 12.454, 11.724, 9.000, 9.471, 10.399, 6.660, 
   5.063, 8.802, 9.941, 7.812, 9.335, 10.263, 10.721, 10.164, 11.365};
time = {DateObject[{2019, 8, 27, 10, 0, 0}], 
   DateObject[{2019, 8, 28, 11, 0, 0}]};
ts = DateListPlot[{TimeSeries[data1, time], TimeSeries[data2, time]}, 
   PlotLegends -> Placed[{"Observed", "Reference"}, Above], 
   ImageSize -> Large, PlotRange -> Full];
active = {{{{Interval[{DateObject[{2019, 8, 27, 10, 0, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 11, 0, 0.`}, "Instant", "Gregorian", 
         8.`]}]}, {"a1"}}, {{Interval[{DateObject[{2019, 8, 27, 10, 0,
           0.`}, "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 20, 29, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 20, 30, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 20, 59, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 21, 0, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 3, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 3, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 5, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 5, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 11, 0, 0.`}, "Instant", "Gregorian", 
         8.`]}]}, {"b1", "b4", "b1", "b4", 
      "b1"}}, {{Interval[{DateObject[{2019, 8, 27, 10, 0, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 16, 59, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 17, 0, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 17, 59, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 18, 0, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 18, 29, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 18, 30, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 18, 59, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 19, 0, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 22, 29, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 22, 30, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 23, 29, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 27, 23, 30, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 0, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 0, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 1, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 2, 0, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 2, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 2, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 4, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 4, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 4, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 5, 0, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 5, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 5, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 7, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 8, 0, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 8, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], 
      Interval[{DateObject[{2019, 8, 28, 9, 0, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 11, 0, 0.`}, "Instant", "Gregorian", 
         8.`]}]}, {"c1", "c8", "c10", "c8", "c10", "c8", "c1", "c6", 
      "c10", "c4", "c8", "c10", "c11", "c9", 
      "c1"}}, {{Interval[{DateObject[{2019, 8, 27, 21, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 27, 22, 29, 0.`}, "Instant", "Gregorian",
          8.`]}], 
      Interval[{DateObject[{2019, 8, 28, 0, 30, 0.`}, "Instant", 
         "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 1, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 2, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 4, 59, 0.`}, "Instant", "Gregorian", 
         8.`]}], Interval[{DateObject[{2019, 8, 28, 5, 30, 0.`}, 
         "Instant", "Gregorian", 8.`], 
        DateObject[{2019, 8, 28, 7, 29, 0.`}, "Instant", "Gregorian", 
         8.`]}]}, {"d5", "d9", "d2", "d11"}}}};
activePlot = 
  ParallelTable[
   TimelinePlot[#, PlotLegends -> Placed[{"A", "B", "C", "D"}, Below],
       PlotStyle -> {ColorData[10, 3], ColorData[10, 4], 
        ColorData[10, 5], ColorData[10, 6]}, 
      DateTicksFormat -> {"Month", "/", "Day", " ", "Hour12Short", 
        "AMPM"}, ImageSize -> Large, 
      Spacings -> 
       1] &@(Table[
          Labeled[#[[i, 1]], #[[i, 2]], Below], {i, 1, Length@#}] &@
        Transpose[#] & /@ active[[i]]), {i, 1, 1}];
Show[ts, activePlot[[1]], ImageSize -> Large]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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