From: Jaebum Jung on
There is an issue with using PlotLegend with DateListPlot (will be fixed
in the future version).

For now, you could convert data to AbsoluteTime to make it work.

Needs["PlotLegends`"]

data1={{{2006,10,1},10},{{2006,10,15},12},{{2006,10,30},15},{{2006,11,20},20}};
data2={{{2006,10,5},15},{{2006,10,20},8},{{2006,11,10},5},{{2006,11,15},1}};

DateListPlot[Map[{AbsoluteTime[#[[1]]],#[[2]]}&,{data1,data2},{2}],PlotLegend->{"sine","cosine"},Joined->True]

Jaebum

On 7/5/10 8:14 PM, divisor wrote:
> Hello MathGroup:
>
> I have this exceeding simple test case from the supplied Documentation
> Center (I added PlotLegend):
>
> Needs["PlotLegends`"]
>
> data1 = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12}, {{2006, 10, 30},
> 15}, {{2006, 11, 20}, 20}};
> data2 = {{{2006, 10, 5}, 15}, {{2006, 10, 20}, 8}, {{2006, 11, 10},
> 5}, {{2006, 11, 15}, 1}};
>
> DateListPlot[{data1, data2}
> , PlotLegend -> {"sine", "cosine"}
> , Joined -> True]
>
> It burps out lots of error messages (mostly about PadRight and Table)
> and does not print the legend.
>
> This simple example works with ListPlot[] and other plotting
> functions. Any help on this is greatly appreciated.
>
> $Version=7.0 for Microsoft Windows (64-bit) (February 18, 2009)
>
> Regards..
>
> Roger Williams
> Franklin Laboratory
>
>