<jupyter_start><jupyter_text>ipywidgets<jupyter_code>from ipywidgets import Button, IntSlider, HBox
button = Button(description='Click me!', button_style='success')
button
button
slider = IntSlider()
slider
slider
slider.value
slider.value = 70<jupyter_output><empty_output><jupyter_text>bqplot<jupyter_code>import numpy as np
from bqplot import *
security_1 = np.cumsum(np.random.randn(150)) + 100.
security_2 = np.cumsum(np.random.randn(150)) + 100.

sc_x = LinearScale()
sc_y = LinearScale()

line = Lines(x=np.arange(len(security_1)), y=security_1,
             scales={'x': sc_x, 'y': sc_y})
ax_x = Axis(scale=sc_x, label='Index')
ax_y = Axis(scale=sc_y, orientation='vertical', label='y-values of Security 1')

Figure(marks=[line], axes=[ax_x, ax_y], title='Security 1', animation_duration=1000)
line.colors = ['DarkOrange']
line.y = np.cumsum(np.random.randn(150)) + 100.
button = Button(description='Click me!', button_style='success')
slider = IntSlider()

def on_click(event):
    line.y = np.cumsum(np.random.randn(150)) + slider.value

button.on_click(on_click)
HBox((button, slider))
x_data = np.random.randn(1000)

x_sc = LinearScale()
y_sc = LinearScale()

hist = Bins(sample=x_data, scales={'x': x_sc, 'y': y_sc}, padding=0,)
ax_x = Axis(scale=x_sc, tick_format='0.2f')
ax_y = Axis(scale=y_sc, orientation='vertical')

Figure(marks=[hist], axes=[ax_x, ax_y], padding_y=0)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup