frombokeh.layoutsimportgridplotfrombokeh.modelsimportBooleanFilter,CDSView,ColumnDataSourcefrombokeh.plottingimportfigure,showx=list(range(-20,21))y0=[abs(xx)forxxinx]y1=[xx**2forxxinx]# create a column data source for the plots to sharesource=ColumnDataSource(data=dict(x=x,y0=y0,y1=y1))# create a view of the source for one plot to useview=CDSView(filter=BooleanFilter([Trueify>250ory<100elseFalseforyiny1]))TOOLS="box_select,lasso_select,hover,help"# create a new plot and add a rendererleft=figure(tools=TOOLS,width=300,height=300,title=None)left.scatter("x","y0",size=10,hover_color="firebrick",source=source)# create another new plot, add a renderer that uses the view of the data sourceright=figure(tools=TOOLS,width=300,height=300,title=None)right.scatter("x","y1",size=10,hover_color="firebrick",source=source,view=view)p=gridplot([[left,right]])show(p)