Mathematica Asked on August 13, 2021
I have data as give below. The DateListPlot
does show a data point beyond 27th March, that is not in the list. I tried to convert the date, set an according range …. I have not found a way to fix it yet. What is going wrong?
The resulting DateListPlot
:
data={{DateObject[{2021, 3, 24, 19, 20, 0.}, "Instant", "Gregorian", 2.], 33.7329},
{DateObject[{2021, 3, 24, 19, 22, 0.}, "Instant", "Gregorian", 2.], 54.0068},
{DateObject[{2021, 3, 24, 19, 25, 0.}, "Instant", "Gregorian", 2.], 51.6781},
{DateObject[{2021, 3, 24, 19, 28, 0.}, "Instant", "Gregorian", 2.], 23.9384},
{DateObject[{2021, 3, 24, 19, 30, 0.}, "Instant", "Gregorian", 2.], 21.7123},
{DateObject[{2021, 3, 24, 19, 32, 0.}, "Instant", "Gregorian", 2.], 45.9247},
{DateObject[{2021, 3, 24, 19, 34, 0.}, "Instant", "Gregorian", 2.], 39.5205},
{DateObject[{2021, 3, 24, 19, 36, 0.}, "Instant", "Gregorian", 2.], 13.1507},
{DateObject[{2021, 3, 24, 19, 38, 0.}, "Instant", "Gregorian", 2.], 34.1438},
{DateObject[{2021, 3, 24, 19, 40, 0.}, "Instant", "Gregorian", 2.], 36.0616},
{DateObject[{2021, 3, 24, 19, 42, 0.}, "Instant", "Gregorian", 2.], 27.4315},
{DateObject[{2021, 3, 24, 19, 44, 0.}, "Instant", "Gregorian", 2.], 29.8973},
{DateObject[{2021, 3, 24, 19, 46, 0.}, "Instant", "Gregorian", 2.], 30.3425},
{DateObject[{2021, 3, 24, 19, 48, 0.}, "Instant", "Gregorian", 2.], 35.5822},
{DateObject[{2021, 3, 24, 19, 50, 0.}, "Instant", "Gregorian", 2.], 37.363},
{DateObject[{2021, 3, 24, 19, 52, 0.}, "Instant", "Gregorian", 2.], 47.1233},
{DateObject[{2021, 3, 24, 19, 54, 0.}, "Instant", "Gregorian", 2.], 41.7123},
{DateObject[{2021, 3, 24, 19, 59, 0.}, "Instant", "Gregorian", 2.], 27.0548},
{DateObject[{2021, 3, 24, 20, 1, 0.}, "Instant", "Gregorian", 2.], 39.7945},
{DateObject[{2021, 3, 24, 20, 3, 0.}, "Instant", "Gregorian", 2.], 24.2808},
{DateObject[{2022, 3, 24, 20, 5, 0.}, "Instant", "Gregorian", 2.], 15.5479},
{DateObject[{2021, 3, 25, 16, 52, 0.}, "Instant", "Gregorian", 2.], 26.4041},
{DateObject[{2021, 3, 25, 16, 54, 0.}, "Instant", "Gregorian", 2.], 44.863},
{DateObject[{2021, 3, 25, 16, 56, 0.00500011}, "Instant", "Gregorian", 2.], 25.0685},
{DateObject[{2021, 3, 25, 16, 58, 0.0100002}, "Instant", "Gregorian", 2.], 18.6301}};
Your data goes beyond March 25, 2021
:
TimeSeries[data]["LastDate"]
2022
is probably a typo. So, we replace it with 2021:
data2 = data /. DateObject[{2022, a__}, b__] :> DateObject[{2021, a}, b];
DateListPlot[data2,
DateTicksFormat -> {"MonthNameShort", " ", "Day", " ", "Hour", ":", "Minute"}]
Correct answer by kglr on August 13, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP