Re: Dashing with alternating colors?
- To: mathgroup at smc.vnet.net
- Subject: [mg80406] Re: [mg80367] Dashing with alternating colors?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Tue, 21 Aug 2007 05:08:53 -0400 (EDT)
- Reply-to: hanlonr at cox.net
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?] >