Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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


  • Prev by Date: Number of Differing Digits & Another Problem (want to see different ways it can be done)
  • Next by Date: Re: Using N function
  • Previous by thread: Re: weird behavior when plotting multiple functions in 6.0
  • Next by thread: JLink and double wrapper classes.