Created
April 17, 2015 21:00
-
-
Save pierrelux/ddc288e88418ab305ef9 to your computer and use it in GitHub Desktop.
Streaming plot in Bokeh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
from bokeh.plotting import * | |
output_server("line_animate") | |
p = figure() | |
p.line([], [], color="#3333ee", name="My stream") | |
show(p) | |
renderer = p.select(dict(name="My stream")) | |
ds = renderer[0].data_source | |
for i in range(10): | |
ds.data["x"].append(i) | |
ds.data["y"].append(np.random.random()) | |
cursession().store_objects(ds) | |
time.sleep(0.05) | |
push() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment