我正在构建一个web应用程序,它将显示图像作为数据分析管道的一部分。为此,我需要动态更改散景中对象Figure
的宽度和高度。动态改变散景的形状图
使用以下代码,Figure
的形状已更改,但更改仅在调整浏览器窗口大小后才生效,即使浏览器窗口调整大小非常小。
import bokeh.plotting
import bokeh.models
import bokeh.layouts
# set up the interface
fig1 = bokeh.plotting.figure()
button = bokeh.models.Button(label='scramble')
# define a callback and connect it
def callback():
fig1.width = int(fig1.width * .8)
button.on_click(callback)
# add everything to the document
bokeh.plotting.curdoc().add_root(bokeh.layouts.column(button, fig1))
是否有一些我需要运行的更新方法?我已经阅读了“下一次刻度线回调”,但我不明白这是否相关。发生
上述行为都与Firefox和铬我的GNOME系统上。
上面的代码以“背景虚化服务” –