MathGroup Archive 2007

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

Search the Archive

Re: Problem with PlotLegend in Mathematica 6.0


Plot "thinks" that fn is a single function, not two.

But Evaluate fixes the problem:

Needs["PlotLegends`"]
fn = {Sin[x], Cos[x]}
Plot[Evaluate@fn, {x, 0, 2 Pi}, PlotLegend -> {"sin", "cos"}]
Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotLegend -> {"sin", "cos"}]

Bobby

On Wed, 20 Jun 2007 04:38:41 -0500, peter.steneteg at gmail.com  
<peter.steneteg at gmail.com> wrote:

> I can not figure out why I get different results for these two cases.
>
> Needs["PlotLegends`"]
> fn = {Sin[x], Cos[x]}
> Plot[fn, {x, 0, 2 Pi}, PlotLegend -> {"sin", "cos"}]
> Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotLegend -> {"sin", "cos"}]
>
> When i use Plot[fn,... the Legend will only show one line, "sin" but
> if I use the later case with Plot[{Sin[x],Cos[x]},... the Legend will
> show correctly. Does anyone have any idea why this happens. And if
> there are any solution?
>
>
>



-- =

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Mathematica 6.0 dynamic display of lists of complex numbers.
  • Next by Date: Re: Same Limit: OK in 5.2, fails in 6.0; Packages gone in 6.0 ???
  • Previous by thread: Re: Problem with PlotLegend in Mathematica 6.0
  • Next by thread: Mathematica 6.0 dynamic display of lists of complex numbers.