'Autoscale the view limits using the data limits.
See :meth:`matplotlib.axes.Axes.autoscale_view` for documentation.
Note that this function applies to the 3D axes, and as such
adds the *scalez* to the function arguments.
.. versionchanged :: 1.1.0
Function signature was changed to better match the 2D version.
*tight* is now explicitly a kwarg and placed first.
.. versionchanged :: 1.2.1
This is now fully functional.'

def autoscale_view(self, tight=None, scalex=True, scaley=True, scalez=True):

    if (not self._ready):
        return
    if (tight is None):
        _tight = (self._tight or ((len(self.images) > 0) and (len(self.lines) == 0) and (len(self.patches) == 0)))
    else:
        _tight = self._tight = bool(tight)
    if (scalex and self._autoscaleXon):
        xshared = self._shared_x_axes.get_siblings(self)
        dl = [ax.dataLim for ax in xshared]
        bb = mtransforms.BboxBase.union(dl)
        (x0, x1) = self.xy_dataLim.intervalx
        xlocator = self.xaxis.get_major_locator()
        try:
            (x0, x1) = xlocator.nonsingular(x0, x1)
        except AttributeError:
            (x0, x1) = mtransforms.nonsingular(x0, x1, increasing=False, expander=0.05)
        if (self._xmargin > 0):
            delta = ((x1 - x0) * self._xmargin)
            x0 -= delta
            x1 += delta
        if (not _tight):
            (x0, x1) = xlocator.view_limits(x0, x1)
        self.set_xbound(x0, x1)
    if (scaley and self._autoscaleYon):
        yshared = self._shared_y_axes.get_siblings(self)
        dl = [ax.dataLim for ax in yshared]
        bb = mtransforms.BboxBase.union(dl)
        (y0, y1) = self.xy_dataLim.intervaly
        ylocator = self.yaxis.get_major_locator()
        try:
            (y0, y1) = ylocator.nonsingular(y0, y1)
        except AttributeError:
            (y0, y1) = mtransforms.nonsingular(y0, y1, increasing=False, expander=0.05)
        if (self._ymargin > 0):
            delta = ((y1 - y0) * self._ymargin)
            y0 -= delta
            y1 += delta
        if (not _tight):
            (y0, y1) = ylocator.view_limits(y0, y1)
        self.set_ybound(y0, y1)
    if (scalez and self._autoscaleZon):
        zshared = self._shared_z_axes.get_siblings(self)
        dl = [ax.dataLim for ax in zshared]
        bb = mtransforms.BboxBase.union(dl)
        (z0, z1) = self.zz_dataLim.intervalx
        zlocator = self.zaxis.get_major_locator()
        try:
            (z0, z1) = zlocator.nonsingular(z0, z1)
        except AttributeError:
            (z0, z1) = mtransforms.nonsingular(z0, z1, increasing=False, expander=0.05)
        if (self._zmargin > 0):
            delta = ((z1 - z0) * self._zmargin)
            z0 -= delta
            z1 += delta
        if (not _tight):
            (z0, z1) = zlocator.view_limits(z0, z1)
        self.set_zbound(z0, z1)
