Re: weird behavior when plotting multiple functions in 6.0
- To: mathgroup at smc.vnet.net
- Subject: [mg76138] Re: weird behavior when plotting multiple functions in 6.0
- From: Daniel Warren <dmaxwarren at gmail.com>
- Date: Wed, 16 May 2007 05:50:56 -0400 (EDT)
- References: <f2btov$iga$1@smc.vnet.net>
Roman, I think the construction you are using effectively maps the Plot function over the list, so each evaluation of Plot only gets a singleton first argument instead of a list and the colors don't come into play. Try f={Sin[x],Cos[x]} instead. This should give Plot a list as a first argument which gets the colors going. OK, just checked it. This works. On May 15, 4:16 am, Roman <rschm... at gmail.com> 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.