MathGroup Archive 2007

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

Search the Archive

Re: Problem with PlotLegend in Mathematica 6.0



Ho peter,

Your first example will not work on any mathematica version prior to 6. 

The reason is that Plot has the attribute HoldAll. Therefore what is fed 

to Plot is: fn. This will not evaluate on prior versions because the 

localized x from Plot and the global x from fn are different variables 

and Plot will complain. There seems to have been a (may be dangerous 

because of lozalitation) change in the implementation of Plot, but there 

seems stiil to exist some hickups. A way out is to overwrite the HoldAll 

by: Plot[Evaulate[fn],...]

hope this helps, Daniel



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?

> 

> 




  • Prev by Date: RE: Button on a palette to create new text cells
  • Next by Date: Re: Mathematica 6.0 dynamic display of lists of complex numbers.
  • Previous by thread: Re: Problem with PlotLegend in Mathematica 6.0
  • Next by thread: Re: Problem with PlotLegend in Mathematica 6.0