old_contents: """
  Aggregate Bar Chart
  -------------------
  This example is a bar chart showing the US population distribution of age groups in 2000..
  """
  
  import altair as alt
  from vega_datasets import data
  
  source = data.population.url
  
  chart = alt.Chart(source).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")
  
new_contents: """
  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 altair.expr import datum
  
  from vega_datasets import data
  pop = data.population.url
  
  chart = alt.Chart(pop).mark_bar().encode(
      x = alt.X('sum(people):Q', axis=alt.Axis(title='population')),
      y = 'age:O'
  ).properties(
      height=300,
      width=300
  ).transform_filter(datum.year == 2000)
  
subject: clean up aggregate bar example