Dear All,
PlotStyle doesn’t work as it should. The PlotStyle does not follow the “colorRange”. There are three different colors (green, blue and red), but they all stay in green?
Please can you help !
Thanks in advance,… Jos
data = {
{{2020, 7, 29, 22, 30}, 0}, {{2020, 7, 29, 22, 45},
2}, {{2020, 7, 29, 22, 58}, 3}, {{2020, 7, 29, 23, 0},
2}, {{2020, 7, 29, 23, 8}, 2}, {{2020, 7, 29, 23, 39},
3}, {{2020, 7, 29, 23, 40}, 3}, {{2020, 7, 30, 2, 38},
2}, {{2020, 7, 30, 2, 42}, 2}, {{2020, 7, 30, 2, 47},
2}, {{2020, 7, 30, 2, 48}, 2}, {{2020, 7, 30, 2, 49},
2}, {{2020, 7, 30, 5, 5}, 4}, {{2020, 7, 30, 5, 6},
4}, {{2020, 7, 30, 5, 7}, 3}, {{2020, 7, 30, 5, 51},
2}, {{2020, 7, 30, 5, 52}, 3}, {{2020, 7, 30, 5, 53},
2}, {{2020, 7, 30, 5, 54}, 3}, {{2020, 7, 30, 5, 55},
3}, {{2020, 7, 30, 6, 32}, 2}, {{2020, 7, 30, 6, 33},
3}, {{2020, 7, 30, 6, 34}, 3}, {{2020, 7, 30, 6, 35}, 0}};
colorRange = {
Green, Blue, Red, Blue, Blue, Blue, Blue, Red, Red, Red, Red, Red,
Red, Red, Red, Red, Red, Red, Red, Red, Red, Red, Red, Green};
DateListPlot[data
, AspectRatio -> 0.8/3, Filling -> Axis,
FrameTicks -> {Automatic, {{{{2020, 7, 29, 22, 30}, "\!\(\*
StyleBox[\"22\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\":\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\"30\",\nFontColor->RGBColor[1, 0, 0]]\)"}, {{2020, 7, 29,
23, 00}, "23:00"}, {{2020, 7, 29, 24, 00},
"24:00"}, {{2020, 7, 30, 01, 00},
"01:00"}, {{2020, 7, 30, 02, 00},
"02:00"}, {{2020, 7, 30, 03, 00},
"03:00"}, {{2020, 7, 30, 04, 00},
"04:00"}, {{2020, 7, 30, 05, 00},
"05:00"}, {{2020, 7, 30, 06, 00},
"06:00"}, {{2020, 7, 30, 06, 35}, "\!\(\*
StyleBox[\"06\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\":\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\"35\",\nFontColor->RGBColor[1, 0, 0]]\)"}}, None}},
ImageSize -> 600, Joined -> False,
LabelStyle -> Directive[Black, Bold, 10]
, PlotStyle -> colorRange
]

