I have some spatially-distributed data. I\'m plotting this with matplotlib.pyplot.hexbin
and would like to change the \"background\" (i.e. zero-value) colour. An ex
hexbin(x,y,mincnt=1)
should do the trick. Essentially, you only want to display the hexagons with more than 1 count in them.
from numpy import linspace
from numpy.random import normal
from pylab import hexbin,show
n = 2**6
x = linspace(-1,1,n)
y = normal(0,1,n)
h = hexbin(x,y,gridsize=10,mincnt=0)
gives,
and h = hexbin(x,y,gridsize=10,mincnt=1)
gives,