Sliders not appearing on graphs

I have copied the example code to generate a 3D plot with a single updating slider, unfortunately the slider does not appear on my plot.

python - 3.7
plotly - 4.2.1
notebook - 5.3
ipywidgets - 7.2

Any help welcome,



import plotly.graph_objs as go
import plotly.offline as py

import numpy as np
from ipywidgets import interactive, HBox, VBox


x = y = np.arange(-5, 5, 0.1)
yt = x[:, np.newaxis]
z = np.cos(x * yt) + np.sin(x * yt) * 2

f = go.FigureWidget(
        go.Surface(z=z, x=x, y=y,
            up=dict(x=0, y=0, z=1),
            center=dict(x=0, y=0, z=0),
            eye=dict(x=1.25, y=1.25, z=1.25))

def update_z(frequency):[0].z = np.cos(x * yt * frequency / 10.0) + np.sin(x * yt * frequency / 10.0) * 2

freq_slider = interactive(update_z, frequency=(1, 50, 0.1))
vb = VBox((f, freq_slider))
vb.layout.align_items = 'center'

from plotly.offline import plot


@craggles17 You are displaying only the plotly figure wuth the last line, plot(f).

Just comment the last two lines and display the VBox (the Vertical Box that contains the 3d figure and the slider) by inserting the line


Is there anyway of exporting that vbox to an offline HTML?

@craggles17 Recently I learned that voila turns Jupyter notebooks into standalone web applications, but I havenโ€™t installed it yet to see how it works.