I decided that it would be nice to write some code to draw a cloud of points.
Of course my first thought was to draw some random points but the result is not cloud-ish, it is well... random.
In the end I decided to use the Mitchell random points algoritmh generating pretty good results:
Blue = Random
Red = Cloud (Michelin)
from __future__ import division import matplotlib.pyplot as plt import random # The more the nearest the points RANDOM_POINTS_PER_GENERATION = 6 def random_point(): return [random.random(), random.random()] def average(lst): return sum(lst) / len(lst) def distance(a,b): return ((a-b)**2 + (a-b)**2) def nearest(random_points, seen_points): def distance_to_points(point): return average([distance(point, seen_point) for seen_point in seen_points]) return min(random_points, key=distance_to_points) def next_point(points): random_points = [random_point() for _ in range(RANDOM_POINTS_PER_GENERATION)] return nearest(random_points, points) def mitchell(number_of_points): """ Generates almost random points, but at each iteration `k` points are generated and the nearest is taken, in order to have a better looking points-cloud. """ points = [random_point()] while len(points) < number_of_points: points.append(next_point(points)) return points def plot_points(points, color): plt.plot(*zip(*points), color=color, linestyle='none', marker='.', markerfacecolor='blue', markersize=4) if __name__ == "__main__": plot_points(mitchell(250), "red") plot_points([random_point() for _ in range(250)], "blue") plt.show()