I'm wondering if it is possible to generate static HTML output and inline plots using Bokeh in the same IPython notebook. What I am currently seeing is that once I either call output_notebook()
or output_file("myfile.html")
I am stuck using that output modality. For example, if I initially use output_notebook
, subsequently calling output_file
does not create an output file.
reset_output()
before the next output_notebook
or output_file
call works at least in version 0.10.0 .
# cell 1
from bokeh.plotting import figure, show, output_notebook, output_file, reset_output
p = figure(width=300, height=300)
p.line(range(5), range(5))
output_notebook()
show(p)
# cell 2
reset_output()
output_file('foo.html')
show(p)
# cell 3
reset_output()
output_notebook()
show(p)
First and third show in notebook, second shows in browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With