diff --git a/altair/examples/line_chart_with_points.py b/altair/examples/line_chart_with_points.py index 26bd54310..3e556411a 100644 --- a/altair/examples/line_chart_with_points.py +++ b/altair/examples/line_chart_with_points.py @@ -1,24 +1,16 @@ """ -Line Chart with Points ----------------------- -This chart shows a simple line chart with points marking each value. Use -``point=True`` for points with default appearance or customize it with -``OverlayMarkDef()``. +Line Chart with Point Markers +----------------------------- +This chart shows a simple line chart with points marking each value. """ # category: line charts import altair as alt -import numpy as np -import pandas as pd +from vega_datasets import data -x = np.arange(100) -source = pd.DataFrame({ - 'x': x, - 'f(x)': np.sin(x / 5) -}) +source = data.stocks() -alt.Chart(source).mark_line( - point=alt.OverlayMarkDef(color="red") -).encode( - x='x', - y='f(x)' +alt.Chart(source).mark_line(point=True).encode( + x='date:T', + y='price:Q', + color='symbol:N' ) diff --git a/altair/examples/line_chart_with_points_stroked.py b/altair/examples/line_chart_with_points_stroked.py new file mode 100644 index 000000000..fd990d98b --- /dev/null +++ b/altair/examples/line_chart_with_points_stroked.py @@ -0,0 +1,18 @@ +""" +Line Chart with Stroked Point Markers +------------------------------------- +This example shows a simple line chart with points in a different color. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +alt.Chart(source).mark_line( + point=alt.OverlayMarkDef(filled=False, fill="white") +).encode( + x='date:T', + y='price:Q', + color='symbol:N' +) diff --git a/altair/examples/multiple_marks.py b/altair/examples/multiple_marks.py deleted file mode 100644 index e262dd306..000000000 --- a/altair/examples/multiple_marks.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -Multiple Marks -============== -This example demonstrates creating a single chart with multiple markers -representing the same data. -""" -# category: other charts -import altair as alt -from vega_datasets import data - -source = data.stocks() - -alt.Chart(source).mark_line(point=True).encode( - x='date:T', - y='price:Q', - color='symbol:N' -)