'Toggle visibility of ticks, ticklabels, and (axis) label.
To turn all off, ::
axis.toggle(all=False)
To turn all off but ticks on ::
axis.toggle(all=False, ticks=True)
To turn all on but (axis) label off ::
axis.toggle(all=True, label=False))'

def toggle(self, all=None, ticks=None, ticklabels=None, label=None):

    if all:
        (_ticks, _ticklabels, _label) = (True, True, True)
    elif (all is not None):
        (_ticks, _ticklabels, _label) = (False, False, False)
    else:
        (_ticks, _ticklabels, _label) = (None, None, None)
    if (ticks is not None):
        _ticks = ticks
    if (ticklabels is not None):
        _ticklabels = ticklabels
    if (label is not None):
        _label = label
    if (_ticks is not None):
        self.major_ticks.set_visible(_ticks)
        self.minor_ticks.set_visible(_ticks)
    if (_ticklabels is not None):
        self.major_ticklabels.set_visible(_ticklabels)
        self.minor_ticklabels.set_visible(_ticklabels)
    if (_label is not None):
        self.label.set_visible(_label)
