N = 10000

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

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

"""
Explanation: WebGL problems
Drag around canvas is shifted down, cut off at top spilling over bottom
End of explanation
"""


!conda list | egrep "jupyter|notebook"

p = figure(plot_height=200, sizing_mode='scale_width')
p.scatter(x, y, alpha=0.1)
show(p)

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,zoom_in,zoom_out,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)

save(p, 'color_scatter.html')

"""
Explanation: Responsive in notebook
Spills a scroll bar.
Not a problem in a vanilla save file.
End of explanation
"""


