# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# # <img src=images/continuum_analytics_b&w.png align="left" width="15%" style="margin-right:15%">

# <h1 align='center'>Bokeh Tutorial</h1>

# ## 1.4 Plotting - Climate

# **Exercise: Plot temperature anomaly monthly average for a given year and month by lat/lon with bokeh.plotting.image_rgba()**
#
# - Data: 'data/Land_and_Ocean_LatLong1.nc'
#
#
#
# *Note: For your convienience, I'm providing an RGBAColorMapper*

from utils.colormap import RGBAColorMapper

# +
# Get the netCDF4 variable for temperature anomaly

# +
# Initialize the colormap with a bokeh palette and the low and high values for the scale.

# +
# Write a function ``get_slice(temperature_variable, year, month)`` that given a temperature variable, year and month
# returns an array of rgba colors. (Hint: Use RGBAColorMapper.color()). 
# -

from bokeh.plotting import figure, output_notebook, show

# +
# Set output option

# +
# Get image data for a given year and month using the ``get_slice`` function

# +
# Create plot
# Tip: Make sure to set x_range and y_range appropriately

# +
# Show plot

# +
# Change the year and month and rerun the plot again.
# -

# **Exercise: Overlay the worldmap boundaries in the temperature image plot**

# +
# Get the worldmap data

# +
# Create your plot

# +
# Show plot

StarcoderdataJupyterScriptsDedupFiltered