Created
December 31, 2018 05:01
-
-
Save sizhky/3dfd734b24a8822964c8f5d70aaa9c8c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from bokeh.plotting import figure, show | |
from bokeh.io import output_notebook, push_notebook | |
%matplotlib inline | |
output_notebook() | |
from math import pi | |
import numpy as np | |
from time import sleep | |
p = figure(title="X vs Random Number Generator", plot_height=350, plot_width=800) | |
target = show(p, notebook_handle=True) | |
x, y = [], [] | |
for i in range(100): | |
# 1. make data | |
x.append(i) | |
y.append(i*0.1*np.random.randint(0, 10)) | |
# 2. call plot | |
p.line(x, y) | |
# 3. push_notebook to the concerned target | |
push_notebook(handle=target) | |
sleep(0.001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment