大小变化的折线图#
这是一个使用 trail
标记来改变线条大小的示例。
import altair as alt
from vega_datasets import data
source = data.wheat()
alt.Chart(source).mark_trail().encode(
x='year:T',
y='wheat:Q',
size='wheat:Q'
)
import altair as alt
from vega_datasets import data
source = data.wheat()
alt.Chart(source).mark_trail().encode(
x='year:T',
y='wheat:Q',
size='wheat:Q'
)
# No channel encoding options are specified in this chart
# so the code is the same as for the method-based syntax.