title: How to plot a 3D histogram with matplotlib/mplot3d?
body: <p>I have three arrays and I am trying to make a 3D histogram.</p>
  
  <pre><code>x = [1, 2, 3, 2, 5, 2, 6, 8, 6, 7]
  y = [10, 10, 20, 50, 20, 20, 30, 10, 40, 50, 60]
  z = [105, 25, 26, 74, 39, 85, 74, 153, 52, 98]
  </code></pre>
  
  <p>Here's my attempt so far: </p>
  
  <pre><code>from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.pyplot as plt
  import numpy as np
  fig = plt.figure()
  ax = plt.axes(projection='3d')
  
  binsOne = sorted(set(x))
  binsTwo = sorted(set(y))
  hist, xedges, yedges = np.histogram2d(x, y, bins=[binsOne, binsTwo])
  xpos, ypos = np.meshgrid(xedges[:-1] + 0.25 , yedges[:-1] + 0.25)
  xpos = xpos.flatten('F')
  ypos = ypos.flatten('F')
  zpos = np.zeros_like(xpos)
  
  dx = dx.flatten()
  dy = dy.flatten()
  dz = hist.flatten()
  
  ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b', zsort='average')
  </code></pre>
  
  <p>How do I incorporate the z array into my 3D histogram? </p>