MathGroup Archive 2007

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

Search the Archive

Re: Dashing with alternating colors?


Plot[2 x^2 - 8 x - 5, {x, 0, 10},
 ColorFunctionScaling -> False,
 ColorFunction ->
  Function[{x, y}, If[EvenQ[Round[x]], Red, Blue]]]


Bob Hanlon

---- AES <siegman at stanford.edu> wrote: 
> Any simple PlotStyle to plot a curve with segments in alternating colors?
> 
> [I can think of plotting the curve twice, in alternating colors, dashed 
> both times, and somehow offsetting the dashes (how to do that 
> accurately?) -- or plotting it solid once, then overlaying it dashed in 
> the other color.  But a neater way?]
> 



  • Prev by Date: On partitioning lists by intervals
  • Next by Date: Any way to exclude branch-cut fills in this plot?
  • Previous by thread: Re: Dashing with alternating colors?
  • Next by thread: On partitioning lists by intervals