How to refresh Bokeh Document

前端 未结 2 1777
梦如初夏
梦如初夏 2021-02-08 15:21

I would like to refresh a bokeh document so I can replace old plots with new ones. However, right now I just get the new plots appended to the document so the old ones don\'t go

2条回答
  •  囚心锁ツ
    2021-02-08 16:13

    Just in case anyone is struggling on how to set the children for layouts when there are multiple elements (say, widgets, more figures, rows etc), you can do so by wrapping the elements in a layout and assigning the children property directly:

    p2 = figure(width=1500, height=500, active_scroll="wheel_zoom")
    p3 = figure(width=1500, height=500, active_scroll="wheel_zoom")
    new_layout = row(p2, p3)
    layout.children = new_layout.children
    

提交回复
热议问题