# four colour theorem

Dear all,

I have a set of Voronoi bins, defined by nodes (x,y) and an underlying mesh of squared bins.
See an example here of such Voronoi bins.

So basically each node, (x,y) would define a Voronoi bin made of a set of squared pixels. So one node would correspond to for example N squared pixels:

node[i] = [(x1,y1),(x2,y2),...(xN,yN)]

I want now to create an imshow like plot of these bins by using the four colour theorem, meaning that I would use 4 colours and want adjacent Voronoi bins not to have the same colour.

Is there a simple way to do this in matplotlib? I couldn't find much on the web so far.

thanks!
Eric

None that I am aware of, but if one existed, it would likely be found within the basemap module. If it isn’t in the Basemap module, it would be an awesome feature to add. Maybe something that would work with my style-cycling mechanism that I have been tinkering with to allow for users to specify 4 different hatchings for b&w publications?

Cheers!
Ben Root

···

On Friday, January 27, 2012, Eric Emsellem <eemselle@…513…> wrote:

Dear all,

I have a set of Voronoi bins, defined by nodes (x,y) and an underlying

mesh of squared bins.
See an example here of such Voronoi bins.

So basically each node, (x,y) would define a Voronoi bin made of a set
of squared pixels. So one node would correspond to for example N squared
pixels:

node[i] = [(x1,y1),(x2,y2),…(xN,yN)]

I want now to create an imshow like plot of these bins by using the four
colour theorem, meaning that I would use 4 colours and want adjacent
Voronoi bins not to have the same colour.

Is there a simple way to do this in matplotlib? I couldn’t find much on
the web so far.

thanks!
Eric