In [1]:
import ipywidgets as widgets

In [2]:
slider = widgets.FloatSlider(min=0, max=10, step=0.5)
slider



In [3]:
text = widgets.FloatText(value=1)
text



In [4]:
text.value


Out[4]:
1.0

In [5]:
text.value = 5
slider.value = 2

In [6]:
widgets.jslink((text, 'value'), (slider, 'value'))

In [7]:
slider.value = 3.0

In [8]:
import bqplot.pyplot as plt
import numpy as np

x = np.linspace(0, 2, 50)
y = x**2

fig = plt.figure()
scatter = plt.scatter(x, y)
plt.show()



In [9]:
fig.animation_duration = 500
scatter.y = x**0.5

In [10]:
scatter.selected_style = {'stroke':'red', 'fill': 'orange'}
plt.brush_selector();

In [11]:
scatter.selected


Out[11]:
[]

In [12]:
scatter.selected = [1,2,10,40]

Other widget libraries

  • pythreejs (3d vis)
  • ipysheet (spreadsheet)
  • ipypivot
  • ...

Ipyleaflet


In [13]:
import ipyleaflet
ipyleaflet.Map(center = [48.7142971, 2.209103], zoom = 14)



In [14]:
_.add_layer(ipyleaflet.ImageOverlay(url='https://jupyter.org//assets/nav_logo.svg', bounds=_.bounds, opacity=0.8))

Integration with vaex


In [15]:
import vaex
import numpy as np
np.warnings.filterwarnings('ignore')
dstaxi = vaex.open('nyc_taxi2015.hdf5') # mmapped, doesn't cost extra memory

In [16]:
dstaxi.plot_widget("pickup_longitude", "pickup_latitude", f="log", backend="ipyleaflet", shape=600)



In [18]:
dstaxi.plot_widget("dropoff_longitude", "dropoff_latitude", f="log", backend="ipyleaflet",
                   z="dropoff_hour", type="slice", z_shape=24, shape=400, z_relative=True,
                   limits=[None, None, (-0.5, 23.5)])



In [19]:
ds = vaex.open('helmi-dezeeuw-2000-FeH.hdf5')

In [20]:
ds.plot_widget("x", "y", f="log", limits=[-20, 20])



In [21]:
ds.plot_widget("Lz", "E", f="log")


ipyvolume


In [22]:
import ipyvolume as ipv
import numpy as np
np.warnings.filterwarnings('ignore')

In [23]:
ipv.example_ylm();



In [24]:
N = 1000
x, y, z = np.random.random((3, N))

In [25]:
fig = ipv.figure()
scatter = ipv.scatter(x, y, z, marker='box')
ipv.show()



In [26]:
scatter.x = scatter.x + 0.1

In [27]:
scatter.color = "green"
scatter.size = 5

In [28]:
scatter.color = np.random.random((N,3))

In [29]:
scatter.size = 2

In [30]:
ipv.figure()
ipv.style.use('dark')
quiver = ipv.quiver(*ipv.datasets.animated_stream.fetch().data[:,::,::4], size=5)
ipv.animation_control(quiver, interval=200)
ipv.show()



In [31]:
ipv.style.use('light')

In [32]:
quiver.size = np.random.random(quiver.x.shape) * 10

In [33]:
quiver.color = np.random.random(quiver.x.shape + (3,))

In [34]:
quiver.geo = "cat"

In [34]:
# stereo

In [35]:
quiver.geo = "arrow"

In [36]:
N = 1000*1000
x, y, z = np.random.random((3, N)).astype('f4')

In [37]:
ipv.figure()
s = ipv.scatter(x, y, z, size=0.2)
ipv.show()



In [38]:
s.size = 0.1

In [39]:
#ipv.screenshot(width=2048, height=2048)

In [40]:
plot3d = ds.plot_widget("x", "y", "z", vx="vx", vy="vy", vz="vz",
                        backend="ipyvolume", f="log1p", shape=100, smooth_pre=0.5)



In [41]:
plot3d.vcount_limits = [70, 100000]

In [42]:
plot3d.backend.quiver.color = "red"

In [43]:
import ipywidgets as widgets

In [43]:
widgets.ColorPicker()



In [44]:
widgets.jslink((plot3d.backend.quiver, 'color'), (_, 'value'))

In [47]:
ipv.save("jupyter-day-paris-2018.html")

In [ ]:
!open jupyter-day-paris-2018.html