Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PlotLegend-> and DateListPlot[]...incompatible or broken?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110816] Re: PlotLegend-> and DateListPlot[]...incompatible or broken?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 7 Jul 2010 07:45:04 -0400 (EDT)

Use Show Legend

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}};

ShowLegend[DateListPlot[
  {data1, data2},
  Joined -> True,
  ImageSize -> 600,
  PlotStyle -> {Lighter[Blue], Darker[Red]}],
 {{
   {Graphics[{Lighter[Blue],
      Line[{{0, 0}, {1, 0}}]}], First},
   {Graphics[{Darker[Red],
      Line[{{0, 0}, {1, 0}}]}], Second}},
  LegendPosition -> {0.9, -0.2},
  LegendSize -> {0.35, 0.35},
  LegendShadow -> None}]


Bob Hanlon

---- divisor <congruentialuminaire at yahoo.com> 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



  • Prev by Date: Re: PlotLegend-> and DateListPlot[]...incompatible or
  • Next by Date: Re: PlotLegend-> and DateListPlot[]...incompatible or broken?
  • Previous by thread: Re: PlotLegend-> and DateListPlot[]...incompatible or broken?
  • Next by thread: Re: PlotLegend-> and DateListPlot[]...incompatible or broken?