RE: Dashing with alternating colors?
- To: mathgroup at smc.vnet.net
- Subject: [mg80394] RE: [mg80367] Dashing with alternating colors?
- From: "David Annetts" <davidannetts at aapt.net.au>
- Date: Tue, 21 Aug 2007 05:02:39 -0400 (EDT)
- References: <200708200736.DAA18662@smc.vnet.net>
Hi,
> 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?]
There is
ListLinePlot[Table[Sin[x], {x, 0, 2 Pi, 0.1}], Joined -> True,
PlotStyle -> Directive[Opacity[0.5], Thick], Mesh -> 10,
MeshFunctions -> {#1 &}, MeshShading -> {Red, Blue}]
>From the online help.
- References:
- Dashing with alternating colors?
- From: AES <siegman@stanford.edu>
- Dashing with alternating colors?