Output widgets function as Python classes and can be assigned to variables. They provide interactive ways to display plots and data in your notebook interface.

Supported Output Widget Types

Below is a comprehensive list of supported output widget types.

Output Widget Reactivity

Output widgets are reactive to changes in their source data. When the source plot or data is updated, the widget display will automatically update to reflect the changes.

Example:

import matplotlib.pyplot as plt
from lplots.widgets.plot import w_plot

# Create initial plot
fig, ax = plt.subplots()
line, = ax.plot([1, 2, 3], [1, 2, 3])
ax.set_title("Dynamic Plot")

# Display the plot
plot = w_plot(label="Updating Plot", source=fig)

# Update the plot data
line.set_ydata([2, 1, 3])
fig.canvas.draw()  # Plot will automatically update in the widget