# Make a colored ListPlot

Basically I have a set of 3D points, such as {3,4,3} or {4,1,4}. Instead of plotting the points in a 3D space, I want to plot the x,y coordinates of the points on the 2D plane and use the z coordinate to define a color for that point. So the color will be different depending on the z coordinate. I've tried a lot of things and haven't had any luck. Any help would be appreciated.

ListPlot

data = RandomInteger[10, {10, 3}];
sdata = Style[{#, #2}, PointSize[.05],
ColorData[{"Rainbow", Through@{Min, Max}@data[[All, -1]]}][#3]] & @@@ data;

ListPlot[sdata, PlotRangePadding -> 3] Or

ListPlot[List /@ data[[All, ;; 2]], PlotRangePadding -> 3,
BaseStyle -> PointSize[.05],
PlotStyle -> (ColorData[{"Rainbow",
Through@{Min, Max}@data[[All, -1]]}] /@ data[[All, -1]])]
(* same picture as above *)


BubbleChart

sdata2 = Style[Labeled[{#, #2, 1}, #3, Center],
Directive[PointSize[.05],
ColorData[{"Rainbow", Through@{Min, Max}@data[[All, -1]]}][#3]]] & @@@ data;

BubbleChart[sdata2] One way is just to build it up from primitives. Here is some data:

SeedRandom;
data = RandomReal[{1, 10}, {10, 3}];


rescale the z values:

data[[All, 3]] = Rescale[data[[All, 3]], {1, 10}];


or rescale over min and max of the z values etc -- up to you. Then plot:

Graphics[{AbsolutePointSize,
MapThread[{Hue[#3], Point[{#1, #2}]} &, Transpose[data]]},
AspectRatio -> 1/GoldenRatio,
Frame -> True] 