假设有以下代码:
# 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)结果是:

为什么pan和hover绘图工具被设置为激活状态?应设置代码,使wheel_zoom和pan为激活的绘图工具。
除此之外,如果执行以下代码行,
dynspread(datashade(layout).opts(width=930, height=300))生成的输出将丢失所有以前的布局样式和网格设置(字体大小、绘图工具、网格规格等):

这一切为什么要发生?
发布于 2020-04-23 02:30:48
请在https://github.com/holoviz/holoviews/issues上提交功能请求,要求将默认工具设置为特定的方式,以便人们可以讨论对默认工具进行任何更改的利弊。
对于第二种情况,请参见https://github.com/holoviz/holoviews/issues/2637,如果您愿意,请加入您的投票。我同意跨操作传播这些设置会很好,但在技术上一点也不简单。
https://stackoverflow.com/questions/61123431
复制相似问题