In [1]:
import numpy as np
from bokeh.plotting import figure, show, output_notebook, hplot, vplot, save
from bokeh.resources import CDN
from bokeh.browserlib import view
output_notebook()
In [2]:
# Make plots
N = 100
x = np.linspace(0, 4*np.pi, N)
y = np.sin(x)
#output_file("scatter.html", title="scatter.py example")
opts = dict(
tools="pan,wheel_zoom,box_zoom,reset,save,box_select",
plot_width=300,
plot_height=300,
)
p1 = figure(**opts)
p1.scatter(x,y, color="#FF00FF", nonselection_fill_color="#FFFF00", nonselection_fill_alpha=1)
p2 = figure(**opts)
p2.scatter(x,y, color="red")
p3 = figure(**opts)
p3.scatter(x,y, marker="square", color="green")
p4 = figure(**opts)
p4.scatter(x,y, marker="square", color="blue")
Out[2]:
In [3]:
# Save to a file
filename = 'hplot.hmtl'
save(hplot(p1, p2), filename=filename, resources=CDN, title='hplot html')
view(filename)
In [4]:
show(hplot(p1, p2,))
Out[4]:
In [32]:
show(vplot(hplot(p3, p4,)))