I am trying to add tabs to my bokeh figure and I am following the example code on the website. However, my code uses glyph to add to the figure and when I use that to add to a panel, I don’t see anything on the graph. Here is my code:
my_time = [1,2,3,4,5,6,7,8,9]
estimated_results = [1,2,3,4,5,6,7,8,9]
# arrange in data source
src = ColumnDataSource(data= {
'time': my_time,
'level': estimated_results,
})
# hover tooltip
TOOLTIPS = [
("Level", "@level"),
]
# create figure
p1 = figure(title="Replay",
x_axis_label = 'Time',
toolbar_location="above",
sizing_mode='stretch_both',
tooltips=TOOLTIPS)
# create individual glyphs
glyph_level = Line(x='time', y='level',
line_color="#1F77B4",
line_width=2,
)
# add to figure. create legends
renderer_level = p1.add_glyph(src, glyph_level)
tab1 = Panel(child=p1, title="Level")
li1 = LegendItem(label='Level', renderers=[renderer_level])
legend = Legend(items=[li1], location='top_right')
p1.add_layout(legend)
tabs = Tabs(tabs=[ tab1])
p1.legend.click_policy="hide"
# display plot
show(tabs)
``
What do I need to change to display the graph correctly?

