python - Bokeh 条形图无法正确显示

标签 python bokeh

我正在尝试在 Bokeh 中构建条形图,我的数据源 (df_fac) 如下所示:

enter image description here

到目前为止我的代码:

# source
source2 = ColumnDataSource(df_fac)


# Bar chart
bar = figure(plot_width=600, plot_height=600,
            x_axis_label='Faculty', 
            y_axis_label='Number of invoice processed & paid', 
            tools=['save', 'reset'])

bar.vbar(x='FACULTY', bottom=0, top='PAPER', width=50, color='STEELBLUE', source=source2)

reset_output()
show(bar)

但是我的输出是这样的:

enter image description here

我的 Bokeh 版本是 0.12.7。我尝试在 Chrome 和 IE 中查看输出,但没有成功。提前致谢。

最佳答案

如果您的绘图类别需要在图中引用(x_range(类别列表,...)

关于python - Bokeh 条形图无法正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46386985/

相关文章:

python - 如何使用 Python 使用 Unicode 编码查找和替换 *.txt 文件中的字符串?

python - Django:存储多个动态排序的模型序列

python - 使用图 block 提供程序时设置 Bokeh 图的缩放级别

python - Bokeh 趋势/补丁图中带有两个参数的悬停工具

python - 如何制作非数值列的散点图?

python - 多元回归 Python

python - 带有 Eclipse 的 OpenCV 2.3.1 Python 显示 synatx 错误但仍在运行

python - CSV 单元格包含 Python 列表

python - 使用 Bokeh Python 没有显示烛台

api - Bokeh API 是否支持 3D 绘图?