MathGroup Archive 2011

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

Search the Archive

Bug with map in conjuntion with plotstyle?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117958] Bug with map in conjuntion with plotstyle?
  • From: Jason Quinn <jason.lee.quinn at gmail.com>
  • Date: Wed, 6 Apr 2011 05:11:23 -0400 (EDT)

values = {0.5, 1.0, 2.0};

f[x_, y_] := x^2 + y

Plot[{f[x, #]} & /@ values, {x, 0, 6}, PlotStyle -> {{Red}, {Blue},
{Yellow}}]

thing = {f[x, #]} & /@ values

Plot[thing, {x, 0, 6}, PlotStyle -> {{Red}, {Blue}, {Yellow}}]



I'm trying to use map to generate a list of functions to plot and use
PlotStyle to define the color and style of the plot. Unfortunately, it
seems like there's a bug here. When map is used with Plot, it applies
the first plotstyle to all the plots.

I think the above is a good test case. The first plot only plots red.
The second plot plots red, blue, and green as desired.

Am I misunderstanding something about plot, map, or plot style? Or is
this a bug?

Jason


  • Prev by Date: Re: Integrate gives wrong results for a simple polynomial
  • Next by Date: Re: ProgressIndicator and ParallelTable problem :(
  • Previous by thread: Re: multiple contexts in package
  • Next by thread: Re: Bug with map in conjuntion with plotstyle?