散景:工具='重置'使图表固定

时间:2018-03-10 07:24:26

标签: python python-3.x plot bokeh

我想在图表上只放置重置工具栏,所以我试图喜欢

logo=None, tools='reset'

实际上放置了重置按钮,但图形是固定的,不能从原始位置移动。

我该如何改进?

1 个答案:

答案 0 :(得分:0)

要移动图表,您只需添加PanTool即可。检查这个最小的例子:

    dataRAW <-  read_delim("./data/something.csv", delim = ",", col_types = cols(
          Column_A = col_integer(),
          Column_B = col_integer(),
          Column_C = col_integer(),
          Column_D = col_integer(),
          Column_E = col_integer()

        ), skip = 1)

使用from bokeh.models import ColumnDataSource from bokeh.plotting import figure from bokeh.io import curdoc plot = figure( width=300, height=300, tools='pan,reset', logo=None, ) x = [1, 2, 3, 4] y = [4, 3, 2, 1] source = ColumnDataSource(data=dict(x=x, y=y)) plot.circle( x='x', y='y', source=source, size=5, fill_alpha=1.0, fill_color='green', line_color=None, ) curdoc().add_root(plot)

运行此功能