I'm trying to produce some graphics like the one shown below, with a few adjustable parameters to change the number and size of cells. The cells positions, sizes and colors should all be random (size between some min and max values):
The whole graphics should be shown inside a simple square, just for convenience for exportation.
My problem is that I really don't know how to start this, since there are many random vertices and straight lines dividing the domains. This is a kind of Mathematica programming problem that I'm unable to do by myself alone. :-(
I could start with a set of random points in a plane, using this code:
RandomPoints =
Table[{RandomReal[{-10, 10}], RandomReal[{-10, 10}]}, {n, 1, 50}];
ListPlot[RandomPoints,
Axes -> False,
Frame -> True,
FrameTicks -> None,
AspectRatio -> 1
]
But then, how to draw lines between these points, without any crossing, so we could get nice looking cells?
So I need suggestions. I don't need anything fancy, just the simplest tricks that I could study and understand. I'm working on Mathematica 7, and I can't change the computer for a newer version of Mathematica yet.
VoronoiMesh
documentation: reference.wolfram.com/language/ref/VoronoiMesh.html and mathematica.stackexchange.com/questions/225510/…. $\endgroup$ComputationalGeometry`
package, which containedVoronoiDiagram
andDiagramPlot
. $\endgroup$