我试图在全息视图覆盖图中使用全息视图范围工具链接。但无法达到工作范围。有可能做到这一点吗。?你知道吗
基于这些链接example 1和example 2,我尝试了覆盖图而不是单一曲线图的选项。但这不管用。下面我提供了一个具有类似虚拟数据的示例。你知道吗
import pandas as pd
import holoviews as hv
from holoviews import opts
import numpy as np
from holoviews.plotting.links import RangeToolLink
hv.extension('bokeh')
# Genrate Random Data
def randomDataGenerator(noOfSampleDataSets):
for i in range(noOfSampleDataSets):
res = np.random.randn(1000).cumsum()
yield res
# Overlay Plots
overlaid_plot = hv.Overlay([hv.Curve(data)
.opts(width=800, height=600, axiswise=True, default_tools=[])
for data in randomDataGenerator(5)])
# Adjust Source Height
source = overlaid_plot.opts(height=200)
# adjust target plot attributes
target = source.opts(clone=True, width=800, labelled=['y'],)
# Link source and target
rtlink = RangeToolLink(source, target)
# Compose and plot.
(target + source).cols(1).opts(merge_tools=False)
我希望源绘图将显示一个范围工具,如示例中所示,并能够在其中选择一个范围,该范围应选择目标绘图中相同的数据点。你知道吗
以下代码适用于我的情况。我稍微重构了代码。但逻辑还是一样的。因此,如果我们有一个重叠的绘图,链接其中一条曲线,在重叠的绘图工程与所有剩余的曲线。你知道吗
相关问题 更多 >
编程相关推荐