MathGroup Archive 2006

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

Search the Archive

Re: Use color with ListPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67947] Re: Use color with ListPlot?
  • From: Helen Read <hpr at together.net>
  • Date: Thu, 13 Jul 2006 06:54:39 -0400 (EDT)
  • References: <e92ehc$lt7$1@smc.vnet.net>
  • Reply-to: HPR <read at math.uvm.edu>
  • Sender: owner-wri-mathgroup at wolfram.com

Xiangdong Liu wrote:
> Hi again,
> 
> This must be a simple question.  How do I make color plots using ListPlot?
> 
> With continuous curve, one can do something like below to get a color plot.
> 
> Plot[{Sin[x], Cos[x]}, {x, 0, 4Pi},
>      PlotStyle->{{RGColorB[0,0,1], RGBColor[0,1,0]}}];
> 
> (well, except that I don't see two colors (B and G) but only one (G)).

Should be:

Plot[{Sin[x], Cos[x]}, {x, 0, 4Pi},
PlotStyle->{RGBColor[0,0,1], RGBColor[0,1,0]}]

Fix the typo in RGBColor, and get rid of the extraneous set of { }.


> With a list of dots that I want to connect, the following line only produces
> uncolored plot.
> 
> ListPlot[{{1,2}, {4, 2}, {1,4}, {4, 2}}, PlotJoined->True,
>          PlotStyle->{{RGBColor[0,0,1]}}];
> 
> Am I doing anything wrong?

Again you have an extra set of { }. Try:

ListPlot[{{1,2}, {4, 2}, {1,4}, {4, 2}}, PlotJoined->True,
PlotStyle->{RGBColor[0,0,1]}]


-- 
Helen Read
University of Vermont


  • Prev by Date: which polynomial interpolant is good for CDFrepresentation
  • Next by Date: Re: "infinite" line through 2 3D points
  • Previous by thread: Re: Use color with ListPlot?
  • Next by thread: Re: Use color with ListPlot?