Say I have a class that contains some data and implements a function that returns a bokeh graph
import bokeh.plotting as bk
class Data():
def plot(self,**kwargs):
return bk.line(**kwargs)
Now I can create several Data objects, such as expsand sets, and create separate graphs. If bk.hold()set, they will end up on the same figure (which is basically what I want).
bk.output_notebook()
bk.figure()
bk.hold()
exps.scatter(arg1)
sets.plot(arg2)
bk.show()

Now I want to aggregate these graphs in GridPlot(), I can do this for non superimposed single graphs
bk.figure()
bk.hold(False)
g=bk.GridPlot(children=[[sets.plot(arg3),sets.plot(arg4)]])
bk.show(g)

but I don’t know how I can superimpose the scatter plots that I had before, like exps.scatter.
Is there a way to get a link to the current active digit, for example:
rows=[]
exps.scatter(arg1)
sets.plot(arg2)
af = bk.get_reference_to_figure()
rows.append(af)
bg.figure()
gp = bk.GridPlot(children=[rows])
bk.show(gp)
source
share