m = 1000
n = 1000
df = pandas.DataFrame(randn(m, n)).cumsum()

def create_plot(swapp_axis):
    fig = bp.figure()
if swapp_axis:
    fig.scatter(df.icol(0), df.index)
else:
    fig.scatter(df.index, df.icol(0))
bp.show(fig)
swapp_axis = ipywidgets.Checkbox(description='swapp_axis', value=False)
ipywidgets.interact(create_plot, swapp_axis=swapp_axis)
bokeh with IPython Notebook widget: extra figures apppearing