Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Defining a different color for each point' topicStudent Support Forum > General > Archives > "Defining a different color for each point"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Michael
11/17/12 9:08pm

In Response To 'Re: Re: Re: Defining a different color for each...'
---------
Building on Bill Simpson's example, if you have a lot of points (like a thousand), then using the VertexColors option of Point will have quite a bit faster rendering time:

polarData =
Table[{j, j, j Cos[j] Sin[j]/(50 \[Pi])}, {j, 0, 100 Pi, 1/10}];

polarPoint[{radius_, angle_, z_}] := {radius*Cos[angle],
radius*Sin[angle]};
myColorFn[{radius_, angle_, z_}] := Hue[z];
Graphics[{PointSize[.05],
Point[polarPoint /@ polarData,
VertexColors -> (myColorFn /@ polarData)]},
Axes -> True]

For a different sort of visualization, you can also use

ListContourPlot[polarToRectangular /@ polarData]

where polarToRectangular is Bill Simpson's

polarToRectangular[{radius_, angle_, color_}] := {radius*Cos[angle],
radius*Sin[angle], color};


URL: ,

Subject (listing for 'Defining a different color for each point')
Author Date Posted
Defining a different color for each point Wes 10/29/12 10:53am
Re: Defining a different color for each point Bill Simpson 10/29/12 12:50pm
Re: Re: Defining a different color for each point Wes 10/30/12 2:30pm
Re: Re: Re: Defining a different color for each... Bill Simpson 10/30/12 8:12pm
Re: Re: Re: Re: Defining a different color for ... Michael 11/17/12 9:08pm
< Previous CommentHelp | Reply To Comment | Reply To Topic