Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line chart with Confidence Interval Band Example #532

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions altair/vegalite/v2/examples/line_with_ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Line chart with Confidence Interval Band
========================================
This example shows how to make a line chart with a confidence interval Band
"""

import altair as alt
from vega_datasets import data

cars = data.cars()

line = alt.Chart(cars).mark_line().encode(
x='Year',
y='mean(Miles_per_Gallon)'
)

confidence_interval = alt.Chart(cars).mark_area(opacity=0.3).encode(
x='Year',
y=alt.Y('ci0(Miles_per_Gallon)', axis=alt.Axis(title='Miles/Gallon')),
y2='ci1(Miles_per_Gallon)'
)

chart = confidence_interval + line