Bokeh Tutorial

1.1 Charts - Timeseries

Exercise: Visualize the evolution of the temperature anomaly monthly average over time with a timeseries chart

  • Data: 'data/Land_Ocean_Monthly_Anomaly_Average.csv'

Tips:

import pandas as pd
pd.read_csv()
pd.to_datetime()

In [ ]:
import pandas as pd
from bokeh.charts import TimeSeries, output_notebook, show

In [ ]:
# Get data

In [ ]:
# Process data

In [ ]:
# Output option

In [ ]:
# Create timeseries chart

In [ ]:
# Show chart

Exercise: Style your plot

Ideas:

  • Add a title
  • Add axis labels
  • Change width and height
  • Deactivate toolbox or customize available tools
  • Change line color

Charts arguments can be found: http://bokeh.pydata.org/en/latest/docs/user_guide/charts.html#generic-arguments


In [ ]:
# Style your timeseries chart

In [ ]:
# Show new chart

Exercise: Add the moving annual average to your chart

Tips:

pd.rolling_mean()

In [ ]:
# Compute moving average

In [ ]:
# Create chart with moving average

In [ ]:
# Show chart with moving average