altair logo altair: types

1 2 3 4 5 6 7 8 9
Notes

You can add type information to an altair chart. You can declare time-based features, nominal features and quantitative features. Specifying the color is also easy.

The bar chart at the end of this video is created via;

(alt.Chart(plot_df)
  .mark_bar(color='lightblue')
  .encode(x='date:T', y='births:Q', color='month:N', tooltip=['date', 'births'])
  .properties(height=200))