clean up aggregate bar example
"""
-Aggregate Bar Chart
--------------------
-This example is a bar chart showing the US population distribution of age groups in 2000..
+Horizontal Aggregate Bar Chart
+------------------------------
+This example is a bar chart showing the distribution of US population
+by age in the year 2000.
"""
import altair as alt
-from vega_datasets import data
+from altair.expr import datum
-source = data.population.url
+from vega_datasets import data
+pop = data.population.url
-chart = alt.Chart(source).mark_bar().encode(
+chart = alt.Chart(pop).mark_bar().encode(
x = alt.X('sum(people):Q', axis=alt.Axis(title='population')),
- y = alt.Y('age:O', scale = alt.Scale(rangeStep = 17))
-).transform_filter("datum.year == 2000")
+ y = 'age:O'
+).properties(
+ height=300,
+ width=300
+).transform_filter(datum.year == 2000)
