There is aesthetics fill , which defaults to ..count.. unless you specify it in stat_binhex . The code below creates the same plot as the source code.
ggplot(df, aes(x, y)) + stat_binhex(aes(fill=..count..))

If you want to have a log scale for calculations, then the solution is pretty straight forward:
ggplot(df, aes(x, y)) + stat_binhex(aes(fill=log(..count..)))

source share