Re: Use color with ListPlot?
- To: mathgroup at smc.vnet.net
- Subject: [mg67948] Re: Use color with ListPlot?
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Thu, 13 Jul 2006 06:54:51 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 7/12/06 at 5:05 AM, liu at vtaix.cc.vt.edu (Xiangdong Liu) wrote:
>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)).
>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?
You have an extra set of curly braces surrounding the color you want. Try
ListPlot[{{1, 2}, {4, 2}, {1, 4}, {
4, 2}}, PlotJoined -> True, PlotStyle -> {RGBColor[0, 0, 1]}];
instead of what you posted.
Also, with version 5.1 basic colors are named. So you could use the simpler syntax
ListPlot[{{1, 2}, {4, 2}, {1, 4}, {
4, 2}}, PlotJoined -> True, PlotStyle -> Blue];
Note, I've not used a list since only one attribute of the default PlotStyle is being altered.
--
To reply via email subtract one hundred and four