Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Generating Your First Figure to a Static HTML File

This video will show you how to output your Bokeh visualation to a static HTML file. Bokeh will generate all of the HTML and Javascript automatically for you, when you run your script.

More information about output_file() can be found in the Bokeh official docs.

File: FirstFigure.py

# Bokeh Libraries
from bokeh.io import output_file
from bokeh.plotting import figure, show

# The figure will be rendered in a static HTML file
# called output_file_test.html
output_file('output_file_test.html', 
            title='Empty Bokeh Figure')

# See what it looks like
show(fig)

Comments & Discussion

Kalesis on Sept. 8, 2019

Hello In the sample code, the object figure() was missing. regards

Become a Member to join the conversation.