'Returns the amount, in data coordinates, that a single pixel
corresponds to in the locality given by "where", which is also given
in data coordinates, and is an x coordinate. "perturb" is the amount
to perturb the pixel.  Usually +0.5 or -0.5.
Implementing this routine for an axis is optional; if present, it will
ensure that no ticks are lost due to round-off at the extreme ends of
an axis.'

def _get_pixel_distance_along_axis(self, where, perturb):

    if (self.axes.name == u'polar'):
        return 0.0
    trans = self.axes.transData
    transinv = trans.inverted()
    pix = trans.transform_point((where, 1e-10))
    ptp = transinv.transform_point(((pix[0] + perturb), pix[1]))
    dx = abs((ptp[0] - where))
    return dx
