【发布时间】:2020-07-05 08:43:46
【问题描述】:
我正在尝试在 Altair 中创建带有点标记的折线图。我正在使用 Altair 文档中的 multi-series line chart example 并尝试将其与 Vega-Lite 文档中的 line chart with stroked point markers example 结合使用。
我感到困惑的是如何处理“mark_line”参数。从 Vega 示例中,我需要使用“点”,然后将“填充”设置为 False。
"mark": {
"type": "line",
"point": {
"filled": false,
"fill": "white"
}
},
如何在 Altair 中应用它?我发现将 'point' 设置为 'True' 或 '{}' 添加了一个点标记,但对如何让填充起作用感到困惑。
source = data.stocks()
alt.Chart(source).mark_line(
point=True
).encode(
x='date',
y='price',
color='symbol'
)
【问题讨论】:
标签: python data-visualization vega-lite altair