“以前的版本”问题与将Bokeh 更新到 0.5.0 中所述的问题相同,现在在一个窗口中绘制所有以前版本的图形。我在 iPython 笔记本中运行它;每次我重新运行单元格时,输出的 html 文件都会显示所有以前的版本,以及新版本。
另一个问题是我无法在输出文件中指定绘图的大小和/或纵横比。
这是整个脚本:
x = [0.4, 0.6, 0.8, 0.5]
y = [0.8, 0.5, 0.8, 0.9]
import bokeh.plotting as bplt
bplt.output_file('output.html')
bplt.figure(tools="wheel_zoom", width=1000, height=3000)
bplt.hold()
bplt.circle(x, y, color='red',
line_color='black', fill_alpha = 0.8, size = 10,
title = 'Ternary plot', background_fill='#dddddd')
bplt.line(x=[0,0.5],y=[1,0.134])
bplt.line(x=[0.5,1],y=[0.134,1])
bplt.line(x=[1,0],y=[1,1])
bplt.show()
无论我为宽度和高度设置什么值,输出始终是相同的大小和纵横比。