Re: PlotStyles
- To: mathgroup at smc.vnet.net
- Subject: [mg30858] Re: [mg30815] PlotStyles
- From: BobHanlon at aol.com
- Date: Thu, 20 Sep 2001 03:52:10 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/9/19 12:47:47 AM, mcoleman at bondspace.com writes:
>Is there a way to apply different PlotStyles to a single list of data
>in a List Plot command? For instance, can I specifiy the first
>half of the data points to be one color, and the remaining half to be
>another, so that it is easy to visually separate the two subsets of data.
>
>I know that this could be done by creating separate graphs and then
>overlaying them, but I'm curious is this can be done within a single
>Plot or ListPlot command.
>
You can use a single MultipleListPlot by partitioning the data
Needs["Graphics`Colors`"];
Needs["Graphics`MultipleListPlot`"];
Needs["Graphics`Graphics`"];
data = Table[{x, Exp[-Sqrt[x]]*Sin[2x]},
{x, 0, 3Pi, Pi/16}];
MultipleListPlot[n=0;
(Take[data, (-1)^n++ * #[(Length[data]+1)/2]])& /@
{Floor, Ceiling}, PlotJoined->True,
Frame->True, Axes->False, PlotRange->All,
FrameTicks->{PiScale, Automatic, None, None},
SymbolShape->None,
PlotStyle->{{AbsoluteDashing[{5,5}], Blue}, Red}];
Bob Hanlon
Chantilly, VA USA