import ipywidgets as widgets
import numpy as np
from bqplot import pyplot as plt
import bqplot
from bqplot import Tooltip
np.random.seed(0)
Cleaning imports
This demo uses voila to render a notebook to a custom HTML page using gridstack.js for the layout of each output. In the cell metadata you can change the default cell with and height (in grid units between 1 and 12) by specifying.
grid_row
grid_columns
n = 1000
x = np.linspace(0.0, 10.0, n)
y = np.cumsum(np.random.randn(n)*10).astype(int)
fig_1 = plt.figure(title='Scatter')
def_tt = Tooltip(fields=['x'], formats=[''])
scatter_1 = plt.scatter(x,y, tooltip=def_tt)
scatter_1.colors=['black']
scatter_1.default_opacities=[1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.2, 0.1, 0.1]
fig_1
Figure(axes=[Axis(scale=LinearScale(), side='bottom'), Axis(orientation='vertical', scale=LinearScale(), side=…