How to replace the legend in interactive Bokeh graph, rather than augment the legend?
问题 I am using a selection dropdown in Bokeh to change what the chart shows. I'd also like the chart's legend to change accordingly. However, what happens instead is the legend becomes augmented every time the user selects a new dropdown value. Eventually, the legend displays every value from every possible dropdown option simultaneously. How do I "clear" the old legend on every new dropdown select? import numpy as np import pandas as pd import os from bokeh.plotting import figure from bokeh.io