我正在尝试将在 seaborn 中构建的下图复制到 altair。我可以在哪里标记某些点,即集群中的预测点。
altair 中的图层功能似乎是方向。
Altair 示例
import altair as alt
import pandas as pd
source = pd.DataFrame({
'x': [1, 3, 5, 7, 9],
'y': [1, 3, 5, 7, 9],
'label': ['A', 'B', 'C', 'D', 'E']
})
bars = alt.Chart(source).mark_point().encode(
x='x:Q',
y='y:Q'
)
text = bars.mark_text(
align='left',
baseline='middle',
dx=7
).encode(
text='label'
)
bars + text
但是我不能只选择一些点在中间用黑点标记。
谢谢