title: plotting 2dhistogram with sum value rather than count
body: <p>Beginner user on the forum. Help please. I have a data set: x, y coordinates, each x, y has a value. I want to plot a 2d histogram displaying the sum of the values in each bin with color scale. matplotlib hexbin is straight forward. I can do this. eg:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  from matplotlib.colors import LogNorm
  
  xpos = np.random.rand(0,10)
  ypos = np.random.rand(0,10)
  plt.hexbin(x = xpos, y = ypos, C=mass, cmap= plt.cm.jet, gridsize=100, reduce_C_function=sum, bins="log")  
  cb = plt.colorbar()
  cb.ax.set_ylabel('log (sum value in each bin)')
  plt.xlabel('Xpos')
  plt.ylabel('Ypos')
  plt.show()
  </code></pre>
  
  <p>However, I'm struggling to make a similar plot with histogram2d or matplotlib hist2d. I think i have to combine binned_statistic_2d and histogram2d somehow. No problem if I replace plt.hexbin line above to this:</p>
  
  <pre><code>plt.hist2d(x = xpos, y = ypos, bins = 50, norm = LogNorm())
  </code></pre>
  
  <p>Any clue? I have look on the forum but can't seem to find a working code. </p>