Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing Bokeh Icon from figures embedded in Jupyter?

I'm making some notebooks in Jupyter, and I decided to use Bokeh for creating interactive plots. Two things that really bug me are the icons printed in the top-left corner of the plots, and the icons printed after running output_notebook(). I'd like to remove these to help minimize visual clutter.

Here's a simple script that can be run in Jupyter demonstrating my issue:

import numpy as np
from bokeh.plotting import *
output_notebook()

N = 100

x = np.linspace(0, 4*np.pi, N)
y = np.sin(x)

TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"

p1 = figure(title="Legend Example", tools=TOOLS)

p1.circle(x, y, legend="sin(x)")
p1.circle(x, 2*y, legend="2*sin(x)", color="orange", )
p1.circle(x, 3*y, legend="3*sin(x)", color="green", )

show(p1)

Here is the output from this code on my machine.

like image 837
Andrew Franklin Avatar asked Mar 14 '23 19:03

Andrew Franklin


1 Answers

The answers to your questions (use output_notebook(..., hide_banner=True) and plot.logo=None) are available in the documentation:

http://docs.bokeh.org/en/latest/docs/reference/resources_embedding.html#bokeh.io.output_notebook

http://docs.bokeh.org/en/latest/docs/reference/models/plots.html#bokeh.models.plots.Plot.logo

like image 166
bigreddot Avatar answered Mar 23 '23 04:03

bigreddot