Limit 2d histogram to max record count
More efficient 2d histogram calculation