<s> from __future__ import print_function <EOL> import time <EOL> from numpy import pi , sin , cos , linspace <EOL> from bokeh . client import push_session <EOL> from bokeh . document import Document <EOL> from bokeh . models import ( <EOL> Plot , DataRange1d , LinearAxis , Range1d , <EOL> ColumnDataSource , PanTool , WheelZoomTool , Line <EOL> ) <EOL> document = Document ( ) <EOL> session = push_session ( document ) <EOL> x = linspace ( - <NUM_LIT:6> * pi , <NUM_LIT:6> * pi , <NUM_LIT:1000> ) <EOL> y = sin ( x ) <EOL> z = cos ( x ) <EOL> source = ColumnDataSource ( data = dict ( x = x , y = y , z = z ) ) <EOL> plot = Plot ( x_range = Range1d ( - <NUM_LIT:2> * pi , <NUM_LIT:2> * pi ) , y_range = DataRange1d ( ) , min_border = <NUM_LIT:50> ) <EOL> line_glyph = Line ( x = "<STR_LIT:x>" , y = "<STR_LIT:y>" , line_color = "<STR_LIT>" ) <EOL> plot . add_glyph ( source , line_glyph ) <EOL> line_glyph2 = Line ( x = "<STR_LIT:x>" , y = "<STR_LIT:z>" , line_color = "<STR_LIT>" ) <EOL> plot . add_glyph ( source , line_glyph2 ) <EOL> plot . add_layout ( LinearAxis ( ) , '<STR_LIT>' ) <EOL> plot . add_layout ( LinearAxis ( ) , '<STR_LIT:left>' ) <EOL> plot . add_tools ( PanTool ( ) , WheelZoomTool ( ) ) <EOL> document . add_root ( plot ) <EOL> print ( "<STR_LIT>" ) <EOL> session . show ( plot ) <EOL> while True : <EOL> for i in linspace ( - <NUM_LIT:2> * pi , <NUM_LIT:2> * pi , <NUM_LIT:50> ) : <EOL> source . data [ '<STR_LIT:x>' ] = x + i <EOL> time . sleep ( <NUM_LIT:0.1> ) </s>
