Re: Problem with PlotLegend in Mathematica 6.0
- To: mathgroup at smc.vnet.net
- Subject: [mg78012] Re: Problem with PlotLegend in Mathematica 6.0
- From: "Kevin J. McCann" <Kevin.McCann at umbc.edu>
- Date: Thu, 21 Jun 2007 05:47:00 -0400 (EDT)
- Organization: University of Maryland, Baltimore County
- References: <f5atgq$apg$1@smc.vnet.net>
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? > > Try wrapping Evaluate[] around the fn in the first plot, i.e. Evaluate[fn]. I am not sure why this is necessary. Kevin