Skip to content

bokeh application inside layout #304

Answered by wang0618
lpinilla asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can use scope:

from pywebio.output import *
from bokeh.io import output_notebook
from bokeh.plotting import figure, show

output_notebook(notebook_type='pywebio')

put_row([
    put_code('text'),
    put_scope('bokeh'),
])

x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend_label="Temp.", line_width=2)

with use_scope('bokeh'):
    show(p)

You will get:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lpinilla
Comment options

Answer selected by lpinilla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants