I have been experimenting with bokeh for a few days now and I have noticed this weird behaviour:
The figure which shows the plot objects may contain plot objects from previous figures.
Unfortunately, I cannot share the exact code, but this is the core of my program:
from bokeh.plotting import scatter, line, hold, show from bokeh.resources import CDN from bokeh.embed import components import pandas as pd measurement = "..." df = ... hold() s = scatter(df['date'], df['value'], size=5, color="red", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="daily", title=measurement) l = line(df['date'], df['value'].mean(), line_width=2, color="grey", alpha=0.5, plot_width=600, plot_height=400, x_axis_type='datetime', legend="total") show() script, div = components(l, CDN) body = div + script
As you can see, I am embedding the graphic into an HTML webpage.
Any idea on what I am doing wrong?