希望按照 UI 的方式做一些事情,如下所示:Bokeh:使用复选框小部件隐藏和显示绘图,其中我可以选择性地在一列图形中显示/隐藏整个图形。我可以选择显示哪些图(假设我可以命名数字)的下拉菜单(带有多个选择的 OptionMenu)会更可取。
我对JS不熟悉,有什么指导吗?(提前致谢)
我希望图像不再可见,下一个图形会像这样跳起来:
例如:
我在生成为的列中有多个数字:
from bokeh.io import output_file, show
from bokeh.layouts import column
from bokeh.plotting import figure
output_file("layout.html")
x = list(range(11))
y0 = x
y1 = [10 - i for i in x]
y2 = [abs(i - 5) for i in x]
# create a new plot
s1 = figure(plot_width=250, plot_height=250, title=None)
s1.circle(x, y0, size=10, color="navy", alpha=0.5)
# create another one
s2 = figure(plot_width=250, plot_height=250, title=None)
s2.triangle(x, y1, size=10, color="firebrick", alpha=0.5)
# create and another
s3 = figure(plot_width=250, plot_height=250, title=None)
s3.square(x, y2, size=10, color="olive", alpha=0.5)
# put the results in a column and show
show(column(s1, s2, s3))
交互式爱情
相关分类