user5601
user5601

Reputation: 878

Interactive slider with multiple controls in a Jupyter notebook?

In a Jupyter notebook, I would like to make an interactive slider with two control points. It's easy to do with a single control see this example:

enter image description here

But here's an example of what I really want, it is called an interval slider (Mathematica does this nicely):

enter image description here

Is this possible to do with ipywidgets or some perhaps other python package?

Upvotes: 8

Views: 2460

Answers (1)

Ed Krohne
Ed Krohne

Reputation: 334

I think what you're getting at is to have arbitrarily many sliders on the same bar, which is what I found this post while looking for, but range sliders do exist (at least they do now; this question is four years old).

widgets.FloatRangeSlider(
    value=[5, 7.5],
    min=0,
    max=10.0,
    step=0.1,
    description='Test:',
    disabled=False,
    continuous_update=False,
    orientation='horizontal',
    readout=True,
    readout_format='.1f',
)

(illustrative snippet stolen directly from linked doc)

Upvotes: 2

Related Questions