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 Jupyter Notebook

This video shows how to generate a Bokeh visualization inline within a Jupyter notebook. To follow along with the example, you will need Jupyter installed.

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

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

# The figure will be right in my Jupyter Notebook
output_notebook()

# Set up a generic figure() object
fig = figure()

# See what it looks like
show(fig)

Comments & Discussion

john09 on June 19, 2019

Great tutorial. I can run Python scripts directly, no problem. Unfortunately, I can’t get the Jupyter notebook to work. I am using Pycharm and started Jupyter notebook as you suggested from the PyCharm terminal. In the web page, the Python syntax is not highlighted and when I try to run, I just get another “In[ ]” box. I don’t know anything about Jupyter notebook. I do see “Connecting to Kernel” in yellow box. I’m guessing that this webpage needs to connect to some kind of Python server. (I’ve got 40 years of coding experience in many languages but am very new to Python).

Become a Member to join the conversation.