Re: bug in PlotLegend?
- To: mathgroup at smc.vnet.net
- Subject: [mg63656] Re: bug in PlotLegend?
- From: Peter Pein <petsie at dordos.net>
- Date: Mon, 9 Jan 2006 04:48:34 -0500 (EST)
- References: <dpo3ki$gbg$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
NatHwylc schrieb:
> If I try PlotLegend in a very simple situation
>
> Plot[Evaluate[{x[t], y[t]} /. s], {t, 0, 100}, PlotStyle -> {Red,
> Green},
> PlotLegend -> {"x", "y"}]
>
> I get a wrong result (i.e. a legend which contains three lines:x,y,x
> instead of only x,y).
>
> Is this a bug or am I making a mistake somewhere?
>
> thanks
>
> nw
>
Hello,
I guess "s" stands for "solution" and is the output of a function like
Solve,NDSolve etc.
In this case, you've got a list of list(s) of rules. Try Evaluate[{x[t], y[t]}
/. First[s]]. This solves the problem.
Peter