Python Bokeh:gridplot到组件灵活布局选项

Python Bokeh:gridplot到组件灵活布局选项,python,bokeh,Python,Bokeh,使用gridplot(),我可以轻松地在网格上布局不同的绘图,使用components()所有绘图的组合html将作为单个变量div_combined返回到我的视图 我想在gridplot html中列出的每个绘图上面包含一些描述,但不知道如何修改视图中组合的div_。我最好不要使用gridplot,只单独返回每个plot html,然后创建额外的GridHTML from bokeh.embed import components from bokeh.plotting import figu

使用gridplot(),我可以轻松地在网格上布局不同的绘图,使用components()所有绘图的组合html将作为单个变量div_combined返回到我的视图

我想在gridplot html中列出的每个绘图上面包含一些描述,但不知道如何修改视图中组合的div_。我最好不要使用gridplot,只单独返回每个plot html,然后创建额外的GridHTML

from bokeh.embed import components
from bokeh.plotting import figure

p1,p2,p3,p4 = figure()
grid = gridplot([[p1, p2], [p3, p4]], plot_width=563, plot_height=325)
script_combined, div_combined = components(grid)

msg = 'Dashboard'
return render_template('grid_view_with_desc.html', msg=msg, script_combined=script_combined, div_combined=div_combined)
谢谢

而不是使用:

p1,p2,p3,p4 = figure()
试试这个:

p1 = figure(plot_width=563, plot_height=325, title='P1 title goes here')
p2 = figure(plot_width=563, plot_height=325, title='P2 title goes here')
p3 = figure(plot_width=563, plot_height=325, title='P3 title goes here')
p4 = figure(plot_width=563, plot_height=325, title='P4 title goes here')

应该有用吗?

谢谢,我需要一整段描述,我想我必须找到另一种方法