'Parameters
ax : Axes
The Axes to put the slider in.
label : str
Slider label.
valmin : float
The minimum value of the slider.
valmax : float
The maximum value of the slider.
valinit : float, optional, default: 0.5
The slider initial position.
valfmt : str, optional, default: "%1.2f"
Used to format the slider value, fprint format string.
closedmin : bool, optional, default: True
Indicate whether the slider interval is closed on the bottom.
closedmax : bool, optional, default: True
Indicate whether the slider interval is closed on the top.
slidermin : Slider, optional, default: None
Do not allow the current slider to have a value less than
the value of the Slider `slidermin`.
slidermax : Slider, optional, default: None
Do not allow the current slider to have a value greater than
the value of the Slider `slidermax`.
dragging : bool, optional, default: True
If True the slider can be dragged by the mouse.
Notes
Additional kwargs are passed on to ``self.poly`` which is the
:class:`~matplotlib.patches.Rectangle` that draws the slider
knob.  See the :class:`~matplotlib.patches.Rectangle` documentation for
valid property names (e.g., `facecolor`, `edgecolor`, `alpha`).'

def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=u'%1.2f', closedmin=True, closedmax=True, slidermin=None, slidermax=None, dragging=True, **kwargs):

    AxesWidget.__init__(self, ax)
    if ((slidermin is not None) and (not hasattr(slidermin, u'val'))):
        raise ValueError(u"Argument    slidermin    ({})    has    no    'val'".format(type(slidermin)))
    if ((slidermax is not None) and (not hasattr(slidermax, u'val'))):
        raise ValueError(u"Argument    slidermax    ({})    has    no    'val'".format(type(slidermax)))
    self.closedmin = closedmin
    self.closedmax = closedmax
    self.slidermin = slidermin
    self.slidermax = slidermax
    self.drag_active = False
    self.valmin = valmin
    self.valmax = valmax
    valinit = self._value_in_bounds(valinit)
    if (valinit is None):
        valinit = valmin
    self.val = valinit
    self.valinit = valinit
    self.poly = ax.axvspan(valmin, valinit, 0, 1, **kwargs)
    self.vline = ax.axvline(valinit, 0, 1, color=u'r', lw=1)
    self.valfmt = valfmt
    ax.set_yticks([])
    ax.set_xlim((valmin, valmax))
    ax.set_xticks([])
    ax.set_navigate(False)
    self.connect_event(u'button_press_event', self._update)
    self.connect_event(u'button_release_event', self._update)
    if dragging:
        self.connect_event(u'motion_notify_event', self._update)
    self.label = ax.text((-0.02), 0.5, label, transform=ax.transAxes, verticalalignment=u'center', horizontalalignment=u'right')
    self.valtext = ax.text(1.02, 0.5, (valfmt % valinit), transform=ax.transAxes, verticalalignment=u'center', horizontalalignment=u'left')
    self.cnt = 0
    self.observers = {}
    self.set_val(valinit)
