Slope Graph#
This example shows how to make Slope Graph.
import altair as alt
from vega_datasets import data
source = data.barley()
alt.Chart(source).mark_line().encode(
x='year:O',
y='median(yield)',
color='site'
)
import altair as alt
from vega_datasets import data
source = data.barley()
alt.Chart(source).mark_line().encode(
x='year:O',
y='median(yield)',
color='site'
)
# No channel encoding options are specified in this chart
# so the code is the same as for the method-based syntax.