'This computes actual onscreen label width.
This uses some black magic to determine onscreen extent of non-drawn
label.  This magic may not be very robust.
This method is not being used, and may be modified or removed.'

def get_real_label_width(self, lev, fmt, fsize):

    xx = np.mean(np.asarray(self.ax.axis()).reshape(2, 2), axis=1)
    t = text.Text(xx[0], xx[1])
    self.set_label_props(t, self.get_text(lev, fmt), u'k')
    bbox = t.get_window_extent(renderer=self.ax.figure.canvas.renderer)
    lw = np.diff(bbox.corners()[0::2, 0])[0]
    return lw
