Re: Re: weird behavior when plotting multiple functions in 6.0
- To: mathgroup at smc.vnet.net
- Subject: [mg76295] Re: [mg76267] Re: weird behavior when plotting multiple functions in 6.0
- From: "Lev Bishop" <lev.bishop at gmail.com>
- Date: Sat, 19 May 2007 04:37:20 -0400 (EDT)
- References: <f2btov$iga$1@smc.vnet.net> <200705181030.GAA13766@smc.vnet.net>
On 5/18/07, Roman wrote: > Hello all, > Here's my attempt at a workaround, defining a plotting function which > will color things properly. I've tried to list all relevant elements > of Options[Plot] in the rules for the mock Plot[] call, and removed > those like Filling which give warnings, but have not tested this very > much yet. Your method looks like it works, but what is wrong with something based on: f[x_?NumericQ]:={Sin[x],Cos[x]} Plot[{f[x][[1]],f[x][[2]]},{x,-\[Pi],\[Pi]}] If your f[] is very expensive to evaluate and you don't want to reevaluate it for the same x value multiple times (once for each element of the vector), then memoize it first: f[x_?NumericQ]:=f[x]=rhs This seems much simpler and less error-prone than your method Lev
- References:
- Re: weird behavior when plotting multiple functions in 6.0
- From: Roman <rschmied@gmail.com>
- Re: weird behavior when plotting multiple functions in 6.0