In [1]:
import numpy as np

from bokeh.plotting import figure
from bokeh.io import show, output_notebook, save

In [2]:
output_notebook()


Loading BokehJS ...

WebGL problems

Drag around canvas is shifted down, cut off at top spilling over bottom.

Bad in 0.12.14 and 0.12.15dev3

Good in 0.12.10


In [3]:
N = 10000

x = np.random.normal(0, np.pi, N)
y = np.sin(x) + np.random.normal(0, 0.2, N)

p = figure(webgl=True)
p.scatter(x, y, alpha=0.1)
show(p)


Responsive in notebook

Spills a scroll bar. Not a problem in a vanilla save file.

Bad in 0.12.6, 0.12.7, 0.12.9, 0.12.10, 0.12.14, 0.12.15dev3

God in 0.12.5


In [4]:
!conda list | egrep "jupyter|notebook"


jupyter                   1.0.0                    py35_4  
jupyter_client            5.2.2                    py35_0  
jupyter_console           5.2.0            py35h4044a63_1  
jupyter_core              4.4.0            py35ha89e94b_0  
notebook                  5.4.0                    py35_0  

In [5]:
p = figure(plot_height=200, sizing_mode='scale_width')
p.scatter(x, y, alpha=0.1)
show(p)



In [6]:
N = 4000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 1.5
colors = [
    "#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)
]

TOOLS="hover,crosshair,pan,wheel_zoom,box_zoom,undo,redo,reset,tap,save,box_select,poly_select,lasso_select,"

p = figure(tools=TOOLS, sizing_mode='scale_width')

p.scatter(x, y, radius=radii,
          fill_color=colors, fill_alpha=0.6,
          line_color=None)

show(p)



In [7]:
save(p, 'color_scatter.html')


/home/bird/miniconda3/envs/bokeh_miscellany/lib/python3.5/site-packages/bokeh/io.py:405: UserWarning: save() called but no resources were supplied and output_file(...) was never called, defaulting to resources.CDN
  warnings.warn("save() called but no resources were supplied and output_file(...) was never called, defaulting to resources.CDN")
/home/bird/miniconda3/envs/bokeh_miscellany/lib/python3.5/site-packages/bokeh/io.py:415: UserWarning: save() called but no title was supplied and output_file(...) was never called, using default title 'Bokeh Plot'
  warnings.warn("save() called but no title was supplied and output_file(...) was never called, using default title 'Bokeh Plot'")
Out[7]:
'/home/bird/Dev/birdsarah/bokeh-miscellany/color_scatter.html'

In [ ]: