Линейная диаграмма с полосой доверительного интервала
Линейная диаграмма с полосой 95%-го доверительного интервала, рассчитанного бутстрэпом.
import altair as alt
from altair.datasets import data
source = data.cars()
line = alt.Chart(source).mark_line().encode(
x='Year',
y='mean(Miles_per_Gallon)'
)
band = alt.Chart(source).mark_errorband(extent='ci').encode(
x='Year',
y=alt.Y('Miles_per_Gallon').title('Miles/Gallon'),
)
band + line
import altair as alt
from altair.datasets import data
source = data.cars()
line = alt.Chart(source).mark_line().encode(
x='Year',
y='mean(Miles_per_Gallon)'
)
band = alt.Chart(source).mark_errorband(extent='ci').encode(
x='Year',
y=alt.Y('Miles_per_Gallon', title='Miles/Gallon'),
)
band + line
Подробнее в связанных разделах документации: