0

更高级别的功能可以scatter正常工作,但是当我尝试绘制原始字形时,绘图是空的:(在 ipython 笔记本中)

import bokeh
import bokeh.plotting as bplot

bplot.reset_output()
bplot.output_notebook()
bplot.figure(x_range=[0,1],
             y_range=[0,1])
bplot.rect(0.5,0.5,0.2,0.2)
bplot.show()

给出一个空图:/

4

1 回答 1

1

尝试这个:

import bokeh
import bokeh.plotting as bplot

bplot.reset_output()
bplot.output_notebook()
bplot.figure(x_range=[0,1],
             y_range=[0,1])
bplot.rect([0.5], [0.5], [0.2], [0.2])
bplot.show()

从文档字符串:

x (str 或 list[float])...

因此,您需要提供一个包含特定点的列表...如果您想绘制多个矩形,这非常有用;-)

于 2014-09-01T15:12:55.260 回答