Dateframe as above and I want to make an interactive graph with scatterplot and slider with year. The scatterplot wasn’t updated with the slicer. Could anyone help me with this? Thanks.
slider = Slider(title='my slider', start=1900, end=2019, step=1, value=1900)
source = ColumnDataSource({'x': a['land'], 'y': a['gross']})
p.circle('x', 'y', source=source)
def update_plot(attr, old, new):
yr = slider.value
new_data = {
'x': a.loc[yr].land,
'y': a.loc[yr].gross,
}
source.data = new_data
slider.on_change('value', update_plot)
layout = column(column(slider),p)
show(layout)