multiple realtime lines in same figure

Hey guys,

Trying to figure out if I can plot two or more realtime lines in the same figure. Here is a slightly modified version of one of the examples given in the docs. As you can see, I’m trying to get “z” plotted but have been unable to get it working. I also tried multiple versions of this but thought maybe somebody has this already figured out. Thanks.

import time
import numpy as np
from bokeh.plotting import *
from bokeh.models import GlyphRenderer

x = [0.]
y = [0.]
z = [0.]

p = figure(title=“simple brownian motion”)
p.line(x,y, color="#2222aa", line_width=1)
#p.line(x,z, color="#66aa22", line_width=1)

ds ={“type”: GlyphRenderer})[0].data_source
while True:
oldx =[“x”]
newx = np.hstack([oldx, [oldx[-1]+1]])[“x”] = newx

oldy =["y"]
newy = np.hstack([oldy, [oldy[-1] + np.random.normal(0,1)]])["y"] = newy

oldz =[“z”]

newz = np.hstack([oldz, [oldz[-1] + np.random.normal(0,1)]])[“z”] = newz