Bokeh (0.12.5) Tools in toolbar are still active after they have been deselected

I currently have 4 plots under one gridplot and I have noticed that when a deselect a tool from its respective toolbar it is still active. For example after I de-select the pan tool I am still able to pan around the graphs. How can I make sure that when I deselect a tool from the toolbar it is indeed not active (so if I deselect the pan tool I don’t want to be able to pan around my graphs)

Here is a GIF displaying my issue

Here is the relevant code for the graphs I generate:

def make_plot(xname, yname, isLog, needsColor, xcolor, needsS, xdr, ydr, xax=False, yax=False):

mbl = between_window_size if yax else 0

mbb = between_window_size if xax else 0

if isLog:

plot = figure(

x_range=xdr, y_range=ydr, background_fill_color=“white”,

border_fill_color=‘white’, plot_width=window_size + mbl, plot_height=window_size + mbb,

min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb,

y_axis_type=“log”, x_axis_type=“log”)

else:

plot = figure(

x_range=xdr, y_range=ydr, background_fill_color=“white”,

border_fill_color=‘white’, plot_width=window_size + mbl, plot_height=window_size + mbb,

min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb)

if not needsS:

plot.xaxis.axis_label = xname

plot.yaxis.axis_label = yname

else:

plot.xaxis.axis_label = “s” + xname

plot.yaxis.axis_label = “s” + yname

if needsColor:

circle = Circle(x=xname, y=yname, fill_color={‘field’: xcolor, ‘transform’: color_mapper}, fill_alpha=0.6, size=5, line_color=None)

else:

circle = Circle(x=xname, y=yname, fill_color = “blue”, fill_alpha=0.6, size=5, line_color=None)

r = plot.add_glyph(self.source, circle)

r.nonselection_glyph = Circle(fill_color=“grey”, fill_alpha = 0.1, line_color=None)

xdr.renderers.append®

ydr.renderers.append®

xticker = BasicTicker()

if xax:

xaxis = LinearAxis(axis_label=xname)

plot.add_layout(xaxis, ‘below’)

xticker = xaxis.ticker

plot.add_layout(Grid(dimension=0, ticker=xticker))

yticker = BasicTicker()

if yax:

yaxis = LinearAxis(axis_label=yname)

plot.add_layout(yaxis, ‘left’)

yticker = yaxis.ticker

plot.add_layout(Grid(dimension=1, ticker=yticker))

plot.add_tools(BoxZoomTool(), WheelZoomTool(), PanTool(), ResetTool(), BoxSelectTool(), TapTool())

plot.xgrid.grid_line_color = None

plot.ygrid.grid_line_color = None

return plot

plots_row1 =

row =

plot1 = make_plot(“degree”, “count”, True, False, “”, False, degree_x_p1, count_y)

plot2 = make_plot(“degree”, “pagerank”, True, True, “pagerank_count”, False, degree_x_p2, pagerank_y)

plot3 = make_plot(“pagerank”, “pagerank_count”, True, False, “”, False, pagerank_x, pagerank_count)

plot4 = make_plot(“clustering_coefficient”, “clustering_coefficient_count”, True, False, “”, False, clustering_coefficient, clustering_coefficient_count)

row.append(plot1)

row.append(plot2)

row.append(plot3)

row.append(plot4)

plots_row1.append(row)

plots_row1 = gridplot(plots_row1)