Re: [Mathematica 6] How to add legend to ListLinePlot?

• To: mathgroup at smc.vnet.net
• Subject: [mg76589] Re: [Mathematica 6] How to add legend to ListLinePlot?
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 24 May 2007 06:11:00 -0400 (EDT)
• Organization: Uni Leipzig
• References: <f311le\$ng2\$1@smc.vnet.net>

```Hi,

ListLinePlot[{a, b},
PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}, Epilog ->
Legend[{{RGBColor[1, 0, 0],
Style["a", "Section"]}, {RGBColor[0, 0, 1],
Style["b", "Section"]}}, LegendPosition -> {7, 0.8},
LegendSize -> {2, 1}, LegendTextSpace -> 0.5] , PlotRange -> All ]

??

it is so clumsy as before ...
Regards
Jens

Nasser Abbasi wrote:
> Hello;
>
> I am drawing few lists in one plot using ListLinePlot.
> PlotLegend does not work with ListLinePlot.  Any idea how can one add legend
> to listLinePlot?
>
> Needs["PlotLegends`"];
> a = Table[RandomReal[], {10}];
> b = Table[RandomReal[], {10}];
> ListLinePlot[{a, b}]  (*OK*)
> ListLinePlot[{a, b}, PlotLegend -> {"a", "b"}]  (*This is what I'd like to
> do*)
>
> thanks
> Nasser
>
>

```

• Prev by Date: Re: Mathematica 6.0 easier for me ... (small review)
• Next by Date: Re: Re: change \$UserDocumentsDirectory
• Previous by thread: RE: [Mathematica 6] How to add legend to ListLinePlot?
• Next by thread: Re: 3 lines of code which crashes Mathematica every time