'Generate a 3D barplot.
This method creates three dimensional barplot where the width,
depth, height, and color of the bars can all be uniquely set.
Parameters
x, y, z : array-like
The coordinates of the anchor point of the bars.
dx, dy, dz : scalar or array-like
The width, depth, and height of the bars, respectively.
color : sequence of valid color specifications, optional
The color of the bars can be specified globally or
individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar
independently.
- An array of colors of length 6, to color the faces of the
bars similarly.
- An array of colors of length 6 * N bars, to color each face
independently.
When coloring the faces of the boxes specifically, this is
the order of the coloring:
1. -Z (bottom of box)
2. +Z (top of box)
3. -Y
4. +Y
5. -X
6. +X
zsort : str, optional
The z-axis sorting scheme passed onto
:func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
shade : bool, optional (default = True)
When true, this shades the dark sides of the bars (relative
to the plot\'s source of light).
Any additional keyword arguments are passed onto
:func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
Returns
collection : Poly3DCollection
A collection of three dimensional polygons representing
the bars.'

def bar3d(self, x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs):

    had_data = self.has_data()
    if (not cbook.iterable(x)):
        x = [x]
    if (not cbook.iterable(y)):
        y = [y]
    if (not cbook.iterable(z)):
        z = [z]
    if (not cbook.iterable(dx)):
        dx = [dx]
    if (not cbook.iterable(dy)):
        dy = [dy]
    if (not cbook.iterable(dz)):
        dz = [dz]
    if (len(dx) == 1):
        dx = (dx * len(x))
    if (len(dy) == 1):
        dy = (dy * len(y))
    if (len(dz) == 1):
        dz = (dz * len(z))
    if ((len(x) != len(y)) or (len(x) != len(z))):
        warnings.warn(u'x,    y,    and    z    must    be    the    same    length.')
    (minx, miny, minz) = (1e+20, 1e+20, 1e+20)
    (maxx, maxy, maxz) = ((-1e+20), (-1e+20), (-1e+20))
    polys = []
    for (xi, yi, zi, dxi, dyi, dzi) in zip(x, y, z, dx, dy, dz):
        minx = min(xi, minx)
        maxx = max((xi + dxi), maxx)
        miny = min(yi, miny)
        maxy = max((yi + dyi), maxy)
        minz = min(zi, minz)
        maxz = max((zi + dzi), maxz)
        polys.extend([((xi, yi, zi), ((xi + dxi), yi, zi), ((xi + dxi), (yi + dyi), zi), (xi, (yi + dyi), zi)), ((xi, yi, (zi + dzi)), ((xi + dxi), yi, (zi + dzi)), ((xi + dxi), (yi + dyi), (zi + dzi)), (xi, (yi + dyi), (zi + dzi))), ((xi, yi, zi), ((xi + dxi), yi, zi), ((xi + dxi), yi, (zi + dzi)), (xi, yi, (zi + dzi))), ((xi, (yi + dyi), zi), ((xi + dxi), (yi + dyi), zi), ((xi + dxi), (yi + dyi), (zi + dzi)), (xi, (yi + dyi), (zi + dzi))), ((xi, yi, zi), (xi, (yi + dyi), zi), (xi, (yi + dyi), (zi + dzi)), (xi, yi, (zi + dzi))), (((xi + dxi), yi, zi), ((xi + dxi), (yi + dyi), zi), ((xi + dxi), (yi + dyi), (zi + dzi)), ((xi + dxi), yi, (zi + dzi)))])
    facecolors = []
    if (color is None):
        color = [self._get_patches_for_fill.get_next_color()]
    if (len(color) == len(x)):
        for c in color:
            facecolors.extend(([c] * 6))
    else:
        facecolors = list(mcolors.to_rgba_array(color))
        if (len(facecolors) < len(x)):
            facecolors *= (6 * len(x))
    if shade:
        normals = self._generate_normals(polys)
        sfacecolors = self._shade_colors(facecolors, normals)
    else:
        sfacecolors = facecolors
    col = art3d.Poly3DCollection(polys, zsort=zsort, facecolor=sfacecolors, *args, **kwargs)
    self.add_collection(col)
    self.auto_scale_xyz((minx, maxx), (miny, maxy), (minz, maxz), had_data)
    return col
