{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import mpld3\n",
    "mpld3.enable_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from mpld3 import plugins\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from dautil import data\n",
    "from dautil import ts\n",
    "\n",
    "df = data.Weather.load()\n",
    "df = df[['TEMP', 'WIND_SPEED']]\n",
    "df = ts.groupby_yday(df).mean()\n",
    "\n",
    "fig, ax = plt.subplots()\n",
    "ax.set_title('Averages Grouped by Day of Year')\n",
    "points = ax.scatter(df['TEMP'], df['WIND_SPEED'],\n",
    "                    s=30, alpha=0.3)\n",
    "ax.set_xlabel(data.Weather.get_header('TEMP'))\n",
    "ax.set_ylabel(data.Weather.get_header('WIND_SPEED'))\n",
    "labels = [\"Day of year {0}\".format(i) for i in range(366)]\n",
    "tooltip = plugins.PointLabelTooltip(points, labels)\n",
    "\n",
    "plugins.connect(fig, tooltip)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
