Hi,
Is it possible to plot as shown in the example below, but have 1 single legend and if the user clicks on one of the legend it hides the plot for all three figures? So link the legend between plots?
from bokeh.io import output_file, show, output_notebook
from bokeh.plotting import figure, row
import pandas as pd
import numpy as np
from bokeh.models import Legend
output_notebook()
x = list(range(11))
df = pd.DataFrame(data = {
'x' : x,
'y0' : x,
'y1' : [10 - i for i in x],
'y2' : [abs(i - 5) for i in x]})
colors = ['red', 'blue', 'yellow']
def plotter(df, colors):
legend_it = []
c = figure(width=400, plot_height=200, title=None)
for i in enumerate(['y0', 'y1', 'y2']):
s = c.circle('x', i[1], source = df, size=10, color=colors[i[0]], alpha=0.5)
legend_it.append((i[1], [s]))
legend = Legend(items=legend_it)
legend.click_policy="mute"
c.add_layout(legend, 'right')
return c
c = plotter(df, colors)
k = -0.75
c_sqrt = plotter(np.sqrt(df), colors)
c_pow = plotter(np.power(df, k), colors)
show(row(c, c_sqrt, c_pow))