2
$\begingroup$

In Mathematica 10.1 I could do the following:

sunrises = {{#, 0}, {#, 5}} & /@ {1514790039, 1514876410, 1514962776, 1515049137};
DateListPlot[sunrises, Joined -> True]
ListPlot[sunrises, Joined -> True]

output1 output2

But since Mathematica 11 DateListPlot seems to behave differently:

DateListPlot::ldata: {{{1514790039,0},{1514790039,5}},{{1514876410,0},{1514876410,5}},{{1514962776,0},{1514962776,5}},{{1515049137,0},{1515049137,5}}} is not a valid dataset or list of datasets.

Apparently, the ListPlot-like syntax is no longer acceptable. So what is the "official" way to achieve this? Or is it simply a bug which should be reported?

$\endgroup$

1 Answer 1

2
$\begingroup$

This appears to be a bug introduced in Mathematica 11.0.1, persisting in 11.1.0, and fixed as of 11.2.0.

$\endgroup$
4
  • $\begingroup$ Did you solve the problem (or bug): DateListPlot::ldata: <|Bhutan->Missing[KeyAbsent,Bhutan],Kiribati->Missing[KeyAbsent,Kiribati],Vanuatu->Missing[KeyAbsent,Vanuatu]|> is not a valid dataset or list of datasets. I face the same problem with version 11.3. $\endgroup$ Commented Oct 28, 2021 at 20:30
  • 1
    $\begingroup$ @TugrulTemel your dataset indeed doesn't appear to be valid for DateListPlot. This function needs a list, rather than an association, and the abscissa values should be dates, rather than variables without value. $\endgroup$
    – Ruslan
    Commented Oct 28, 2021 at 21:41
  • $\begingroup$ Do you have an idea for fixing the problem. Maybe I can show you the database created to see the data format. I appreciate your reply. $\endgroup$ Commented Oct 29, 2021 at 11:28
  • 1
    $\begingroup$ @TugrulTemel your problem seems to be independent of this question. It's more appropriate to make a new question, rather than chat in comments to this answer. $\endgroup$
    – Ruslan
    Commented Oct 29, 2021 at 13:31

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.