Bug introduced in 10.1 and fixed in 10.3
TimeLinePlot was introduced in 10.1

I have some data from wikipedia.

str = URLFetch["http://en.wikipedia.org/wiki/Mathematica"];
AllDate = StringCases[str, DatePattern[{"MonthName", " ", "Day", ", ","Year"}]][[;; 26]];
AllVersion = StringCases[str, "<li>Mathematica " ~~ Shortest[v__] ~~ "(" :> v][[-26 ;;]];


Now I can show some interesting,like this:

ShowDifferenceDate[version_,
date_] := {Rule @@@ Partition[version, 2, 1],
DateDifference[##, {"Year"}] & @@@ Partition[date, 2, 1]} //
Transpose // Flatten // Partition[#, 4, 4, 1, " "] & // TableForm;
{someVersion, someDate} = Transpose[GatherBy[Transpose[{AllVersion, AllDate}],
StringTake[First@#, 1 ;; 2] &][[All, 1]]];
ShowDifferenceDate[AllVersion, AllDate]
ShowDifferenceDate[someVersion, someDate]


picture 1

picture 2

Now I want to use TimelinePlot.It is Ok like this:

TimelinePlot[Association[Rule @@@ Transpose@{AllVersion, DateList /@ AllDate}]]


picture 3

It is ugly.So I want to make it beautiful.For example,different colors for different Big Version(1.0,1.1,1.2 are the same color, but 1.0,2.0 are different color).So I try to do this:

TimelinePlot[Association /@
GatherBy[Rule@@@Transpose@{AllVersion,DateList/@AllDate}, StringTake[First@#, 1 ;; 2] &]]


But it Failed.

Part::partw : Part2 of {{Directive[AbsolutePointSize[5], RGBColor[0.368, 0.507, 0.710],AbsoluteThickness[1.6], Opacity1]}} does not exist.

Why it Failed? Is it bug about TimelinePlot?

How to make this picture(TimelinePlot) beautiful?

Thanks!

• @Mahdi Thanks for pointing out my mistake! – Apple May 29 '15 at 8:17
• You're welcome. I had a typo in my own comment, so funny! :D – Mahdi May 29 '15 at 8:32
• @Mahdi Did you post the answer as a comment and then delete it? I'm trying to figure out whether this question can be closed or not, and it's complicated if I don't know for sure that it's been answered or whether the mistake was "simple" (requirement for closing the question.) – C. E. May 29 '15 at 12:08
• @Pickett Sorry.My code is missing a comma at the beginning due to my carelessness,so Mahdi told me this mistake,and then I add one comma in my code.But my problem is not settled. – Apple May 29 '15 at 12:28
• It appears that TimeLinePlot doesn't work correctly with lists of associations. – Gordon Coale May 30 '15 at 0:38

This bug appears to be fixed in MMA 10.3:

One can workaround this issue by using nested lists instead of associations.

TimelinePlot[GatherBy[
Rule @@@ Transpose@{DateList /@ AllDate, AllVersion},
StringTake[Last@#, 1 ;; 2] &
]]


It appears that TimelinePlot doesn't handle multiple Associations very gracefully. One imperfect workaround is to use Show

tlp1 = TimelinePlot[{Entity["HistoricalEvent", "WorldWar2"],
Entity["HistoricalEvent", "VietnamWar"]}];

tlp2 = TimelinePlot[{Style[{Entity["HistoricalEvent", "WorldWar1"],
Entity["HistoricalEvent", "KoreanWarBegins"]}, Red]}];

Show[tlp1, tlp2]
`

Gives :

You can probably tweak it but you get the gist.

• Multiple associations should work however, right? So I think this is a bug; do you? – Mr.Wizard May 30 '15 at 1:30
• @mr.wizard. I agree. Tried it with Datasets too with similar errors. – Gordon Coale May 30 '15 at 8:24