I’ve run into bokeh server problems when running on linux, and I wrote a simpler program to see if the error persists. The simpler program is as follows:
from numpy import linspace, sin, cos, pi
import bokeh.plotting as plt
from bokeh.models import Range1d
fig_size = 750
ind = 0
def draw_map():
tools = "pan,wheel_zoom,reset,previewsave"
fig = plt.figure(title='', logo=None, tools=tools, webgl=True, x_range=Range1d(0, 15, bounds='auto'),
y_range=Range1d(-2, 2, bounds='auto'),
toolbar_location='above', plot_width=fig_size, plot_height=fig_size, min_border=10)
return fig
def read_tracks():
n = 50
tracks = [list(linspace(0, 4 * pi, n)), list(sin(linspace(0, 4 * pi, n)))]
return tracks
tracks = read_tracks()
fig = draw_map()
route = fig.line([0, 0], [0, 0], color='red', line_width=3, alpha=0.5, name='track')
def update():
global ind
print(ind)
route.data_source.data['x'] = tracks[0][ind:]
route.data_source.data['y'] = tracks[1][ind:]
ind = ind + 1 if ind < len(tracks[0]) - 2 else 0
plt.curdoc().add_periodic_callback(update, 500)
plt.curdoc().add_root(fig)…
``
On mac, I see the display jitter. The sin curve being updated jumps for a very short time. I output ‘ind’ within the callback, and though on mac it is sequential, I find that on linux it is not sequential. There seems to be two threads going on.
Moreover, on mac if I use plt.curdoc().add_periodic_callback(update, 100)
, the plot errors when ind reaches 98.
On mac, I see the display The program is run using “bokeh serve --show program.py”
I’m using the latest version of bokeh.
Can anyone else replicate this problem?