import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
# Create a function to plot the data
def plot(x, a, b):
= a * np.sin(b + x)
y
plt.plot(x, y)
plt.show()
# Create the widgets
= np.linspace(0, 2 * np.pi, 100)
x = widgets.FloatSlider(value=0, min=0, max=np.pi, step=0.01, description="a:")
widget_a = widgets.FloatSlider(value=2.5, min=0.1, max=5.0, step=0.1, description="b:")
widget_b
# Use the interact function to create the interactive plot
=widgets.fixed(x), a=widget_a, b=widget_b) widgets.interact(plot, x
Widgets
analyze
notebooks
Learn how to use Jupyter widgets within TileDB notebooks and dashboards.
TileDB notebooks fully support usage of Jupyter/IPython widgets, to provide user-manipulated graphical components. Widgets enable direct user feedback, which can influence the display of plots or other output.
Please see the Juptyer widget documentation for a list of widgets and interaction examples.