我目前正在尝试将 holoviews+datashader 与 matplotlib 后端一起使用。我使用的数据有非常不同的 x 和 y 范围,结果是数据着色器图被无用地拉伸。我尝试使用的 opts 和 output 关键字可以解决仅使用全息视图的问题,但一旦应用数据阴影就无法解决。
例如:
import holoviews as hv
hv.extension('matplotlib')
import numpy as np
from holoviews.operation.datashader import datashade
np.random.seed(1)
positions = np.random.multivariate_normal((0,0),[[0.1,0.1], [0.1,50.0]], (1000000,))
positions2 = np.random.multivariate_normal((0,0),[[0.1,0.1], [0.1,50]], (1000,))
points = hv.Points(positions,label="Points")
points2 = hv.Points(positions2,label="Points2")
plot = datashade(points) + points2
plot
生成: 数据着色器和点输出
我可以使用 fig_size opts 关键字来控制点的大小
e.g. points2(plot=dict(fig_size=200))
但同样不适用于数据着色器图。任何有关使用 matplotlib 更改此类数据着色器图形大小的建议将不胜感激。理想情况下,我想使用函数而不是单元格魔术关键字,以便可以将代码移植到脚本中。
谢谢!