Nextjournal / May 13 2020
Bokeh Template
Configure Bokeh and setup imports.
import numpy as np
from bokeh.plotting import figure, output_file, show
output_file('/results/bokeh-1.html')
0.0s
Python
And start plotting.
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" % (r, g, 150) for r, g in zip(np.floor(50+2*x).astype(int), np.floor(30+2*y).astype(int))]
p = figure()
p.circle(x, y, radius=radii, fill_color=colors, fill_alpha=0.6, line_color=None)
show(p);
0.3s
Python