Mathematica 9 is now available
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: weird behavior when plotting multiple functions in 6.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76081] Re: weird behavior when plotting multiple functions in 6.0
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 16 May 2007 05:21:43 -0400 (EDT)
  • References: <f2btov$iga$1@smc.vnet.net>


Hi Roman,

simply tell mathematica to evaluate f[x] before sendig it to Plot:

Plot[Evaluate[f[x]],{x,0,4*Pi}]

hope this helps, Daniel



Roman wrote:

> Hello all:

> 

> When I plot

>     Plot[{Sin[x], Cos[x]}, {x, 0, 4*Pi}]

> I get two curves: one blue, one red.

> 

> But when I do

>     f[x_] = {Sin[x], Cos[x]};

>     Plot[f[x], {x, 0, 4*Pi}]

> both curves are blue. It is as if at some level Mathematica does not

> understand that I'm actually plotting two curves at a time, and uses

> the first color specification (blue) for both curves.

> 

> This is particularly annoying when you want to play with plot styles,

> for example filling instructions, like

>     Filling -> {1 -> -1, 2 -> 1}

> which works in the first example but not in the second one.

> 

> Has anyone figured out a workaround for this one?

> 

> Thanks!

> Roman.

> 

> 




  • Prev by Date: Re: 2D Convolution
  • Next by Date: An (undocumented?) feature of CompoundExpression and Out
  • Previous by thread: Re: weird behavior when plotting multiple functions in 6.0
  • Next by thread: Re: weird behavior when plotting multiple functions in 6.0