Re: Listplot with colours
- To: mathgroup at smc.vnet.net
- Subject: [mg90851] Re: [mg90819] Listplot with colours
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 26 Jul 2008 04:21:59 -0400 (EDT)
- Reply-to: hanlonr at cox.net
points = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
att1 = {1, .3, .5, .7};
att2 = {.05, .1, .05, .075};
Show[Graphics[Transpose[
{Hue /@ att1, PointSize /@ att2, Point /@ points}]],
Axes -> True]
ListPlot[List /@ points,
PlotStyle -> Transpose[{Hue /@ att1, PointSize /@ att2}],
PlotRange -> {{-0.1, 1.1}, {-0.1, 1.1}},
AspectRatio -> 1]
In version 6:
Graphics[Transpose[
{Hue /@ att1, PointSize /@ att2, Point /@ points}],
Axes -> True]
Bob Hanlon
---- "King wrote:
=============
I cannot find this in the help at all, although I am sure it is
straightforward.
I have a list of coordinates of points points={{x1,y1},{x2,y2}...}
and two lists of attributes att1={a1,a2,..} and att2={b1,b2,...}
I want to do something like
ListPlot[points,PlotStyle->{Hue[att1],PointSize[att2]}]
So I get dots at each point in colour att1 and size given by att2. I'm
sure it's easy but I can't do it. I am using version 5.1
Many thanks,
Peter