Make the histogram tool work with 2d surface