{
 "metadata": {
  "name": "",
  "signature": "sha256:7ea0f2b8a8a99454ceff405db379afffc7ecda77cd2233252b681539eb1851e6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import bokeh\n",
      "bokeh.load_notebook()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from collections import OrderedDict\n",
      "\n",
      "import numpy as np\n",
      "\n",
      "from bokeh.charts import Line\n",
      "\n",
      "# create some example data\n",
      "xyvalues = OrderedDict(\n",
      "    python=[2, 3, 7, 5, 26, 221, 44, 233, 254, 265, 266, 267, 120, 111],\n",
      "    pypy=[12, 33, 47, 15, 126, 121, 144, 233, 254, 225, 226, 267, 110, 130],\n",
      "    jython=[22, 43, 10, 25, 26, 101, 114, 203, 194, 215, 201, 227, 139, 160],\n",
      ")\n",
      "\n",
      "# create an area chart\n",
      "line = Line(\n",
      "    xyvalues, title=\"Area Chart\", xlabel='time',\n",
      "    ylabel='memory', facet=False, notebook=True,\n",
      ")\n",
      "line.legend(\"top_left\").show()\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "line.facet = True\n",
      "line.legend(\"top_left\").show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import pandas as pd\n",
      "\n",
      "# Here is some code to read in some stock data from the Yahoo Finance API\n",
      "AAPL = pd.read_csv(\n",
      "    \"http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000\",\n",
      "    parse_dates=['Date'])\n",
      "MSFT = pd.read_csv(\n",
      "    \"http://ichart.yahoo.com/table.csv?s=MSFT&a=0&b=1&c=2000\",\n",
      "    parse_dates=['Date'])\n",
      "IBM = pd.read_csv(\n",
      "    \"http://ichart.yahoo.com/table.csv?s=IBM&a=0&b=1&c=2000\",\n",
      "    parse_dates=['Date'])\n",
      "\n",
      "sxyvalues = OrderedDict(\n",
      "    AAPL=AAPL['Adj Close'],\n",
      "    MSFT=MSFT['Adj Close'],\n",
      "    IBM=IBM['Adj Close'],\n",
      ")\n",
      "\n",
      "# create an area chart\n",
      "line = Line(\n",
      "    sxyvalues, title=\"Medals\",\n",
      "    ylabel='Performance', facet=False, notebook=True,\n",
      ")\n",
      "line.legend(\"top_left\").show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "line.facet()\n",
      "line.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# create an area chart\n",
      "df = pd.DataFrame(sxyvalues)\n",
      "line = Line(\n",
      "    df, title=\"Area Chart\",\n",
      "    ylabel='Performance', facet=False, notebook=True,\n",
      ")\n",
      "line.legend(\"top_left\").show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "line = Line(\n",
      "    list(sxyvalues.values()), title=\"Area Chart\",\n",
      "    ylabel='Performance', facet=False, notebook=True,\n",
      ")\n",
      "line.legend(\"top_left\").show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}