Edit: Mathematica 7
All of the function is come from Version 7. But it seems that the RegionPlot
have updated more from version 7.
Ndomain = 500;
levels = 5;
RandomTiles =
Table[{RandomReal[], RandomReal[], RandomInteger[{1, levels}]}, {n,
1, Ndomain}];
graph = ListPlot3D[RandomTiles, InterpolationOrder -> 0, Mesh -> None,
Axes -> False, Boxed -> False];
pts = Cases[graph, GraphicsComplex[x___] :> x, Infinity] // First;
polygons = Cases[graph, GraphicsGroup[x___] :> x, Infinity] // First;
indexs = Level[polygons, {-2}];
groupindexs = GatherBy[indexs, Last[Last@pts[[#]]] &];
grouppts = Map[Drop[#, -1] & /@ pts[[#]] &] /@ groupindexs;
length = Length@groupindexs;
colors = ColorData["CandyColors"] /@ Range[0, 1, 1/length];
regs = Polygon /@ grouppts;
Table[RegionPlot[regs[[i]], PlotStyle -> colors[[i]], Frame -> False,
BoundaryStyle -> {White, Thick}], {i, 1, length}] // Show
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/09YB6.png)
Original:2D Method
OK! I found a way suitable for Mathematica 7.0 and it is a 2D method,not just 3D method.
Ndomain = 500;
levels = 5;
RandomTiles =
Table[{RandomReal[], RandomReal[], RandomInteger[{1, levels}]}, {n,
1, Ndomain}];
graph = ListPlot3D[RandomTiles, InterpolationOrder -> 0, Mesh -> None,
Axes -> False, Boxed -> False];
pts = Cases[graph, GraphicsComplex[x___] :> x, Infinity] // First;
polygons = Cases[graph, GraphicsGroup[x___] :> x, Infinity] // First;
indexs = Level[polygons, {-2}];
groupindexs =
GroupBy[indexs, Last[Last@pts[[#]]] &,
Map[Drop[#, -1] & /@ pts[[#]] &]];
regs = Polygon /@ groupindexs // Values;
colors = ColorData["CandyColors"] /@ Subdivide[0, 1, levels];
Table[RegionPlot[regs[[i]], PlotStyle -> colors[[i]], Frame -> False,
BoundaryStyle -> {White, Thick}], {i, 1, levels}] // Show
Original: 3D method
I can't find the way suitable for Mathematica 7.0.
So here just provided a idea.
Ndomain = 500;(*Number of tiles*)RandomTiles =
Table[{RandomReal[], RandomReal[], RandomInteger[{1, 5}]}, {n, 1,
Ndomain}];
graph = ListPlot3D[RandomTiles, InterpolationOrder -> 0];
regs = DiscretizeGraphics[graph];
RegionPlot3D[regs, ViewPoint -> {0, 0, Infinity}, Boxed -> False,
BoundaryStyle -> Thick,
ColorFunction -> Function[{x, y, z}, ColorData["CandyColors"][z]],
ColorFunctionScaling -> True, ImageSize -> {500, 500}]