如何访问/导出全息视图(六角片)渲染

2024-05-22 09:37:28 发布

您现在位置:Python中文网/ 问答频道 /正文

是否有办法访问中包含的聚合数据,例如

import holoviews as hv
import numpy as np
hv.HexTiles(np.random.rand(100,2)).options(gridsize=4)

这是所有六边形的位置和值(这里是:计数)?你知道吗


Tags: 数据importnumpyasnprandomoptionsholoviews
1条回答
网友
1楼 · 发布于 2024-05-22 09:37:28

还有,matplotlib在内部执行聚合,但是bokeh后端使用返回聚合数据的操作,以及定义十六进制网格的qr坐标。您可以导入并使用如下操作:

import holoviews as hv
import numpy as np
from holoviews.plotting.bokeh.hex_tiles import hex_binning


hextiles = hv.HexTiles(np.random.rand(100,2))
df = hex_binning(hextiles, gridsize=4).dframe()
df.head()

如果你需要计算六边形的x/y位置,你必须阅读六边形offset coordinates。你知道吗

相关问题 更多 >