code: def bar3d(h2: Histogram2D, ax: Axes3D, **kwargs):
      
      density = kwargs.pop("density", False)
      data = get_data(h2, cumulative=False, flatten=True, density=density)
  
      if "cmap" in kwargs:
          cmap = _get_cmap(kwargs)
          _, cmap_data = _get_cmap_data(data, kwargs)
          colors = cmap(cmap_data)
      else:
          colors = kwargs.pop("color", "blue")
  
      xpos, ypos = (arr.flatten() for arr in h2.get_bin_centers())
      zpos = np.zeros_like(ypos)
      dx, dy = (arr.flatten() for arr in h2.get_bin_widths())
  
      _add_labels(ax, h2, kwargs)
      ax.bar3d(xpos, ypos, zpos, dx, dy, data, color=colors, **kwargs)
      ax.set_zlabel("density" if density else "frequency")
docs: Plot of 2D histograms as 3D boxes.