Holoviews 主动工具配置和数据加载器布局。

问题描述 投票:0回答:1

假设有以下代码。

# Layout creation
y1 = hv.Curve((dt, data['Noise 1']), 'Date', 'y(t)', label='Noise 1')
y2 = hv.Curve((dt, data['Noise 2']), 'Date', 'y(t)', label='Noise 2')
layout = y1 + y2

# Grid style layout
gridstyle = {
    'grid_line_color': 'lightgray',
    'grid_line_width': 1,
    'minor_grid_line_color': 'lightgray',
    'minor_grid_line_width': 0.5,
    'minor_grid_line_dash': 'dashed'
}

# Layout style options
layout.opts(opts.Curve(
    width=930, 
    height=300, 
    line_width=2, 
    fontscale=1.5,
    color='blue',
    tools=['hover', 'help'],
    active_tools=['wheel_zoom', 'pan'],
    gridstyle=gridstyle,
    show_grid=True
)).cols(1)

结果是:

Result_1

为什么是 panhover 绘图工具设置为激活?代码的设置应该是这样的 wheel_zoompan 是活动的绘图工具。

除此之外,如果执行以下一行代码。

dynspread(datashade(layout).opts(width=930, height=300))

由此产生的输出会丢失所有之前的布局样式和网格设置(字体大小、绘图工具、网格规格等)。

Image_2

为什么会发生这种情况?

bokeh holoviews datashader pyviz holoviz
1个回答
0
投票

请在以下地方提交功能请求 https:/github.comholovizholoviewsissues 要求将默认工具设置为某种方式,以便人们可以讨论对默认工具的任何更改的利弊。

对于第二种情况,请看 https:/github.comholovizholoviewsissues2637。 如果你愿意的话,也可以来投票。我同意在各个操作中传播这样的设置是好事,但技术上根本不直接。

© www.soinside.com 2019 - 2024. All rights reserved.