Re: Dashing with alternating colors?
- To: mathgroup at smc.vnet.net
- Subject: [mg80397] Re: Dashing with alternating colors?
- From: Helen Read <hpr at together.net>
- Date: Tue, 21 Aug 2007 05:04:12 -0400 (EDT)
- References: <fabgd2$i93$1@smc.vnet.net>
- Reply-to: HPR <read at math.uvm.edu>
AES 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?]
Something like this?
Plot[Sin[x], {x, -2 \[Pi], 2 \[Pi]}, Mesh -> 20,
MeshFunctions -> {#2 &}, MeshShading -> {Red, Blue},
PlotStyle -> Thick]
--
Helen Read
University of Vermont