{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"http://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"7c9e02b2-b27e-4a15-9c45-db68e6883ecd\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(global) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    window._bokeh_onload_callbacks = [];\n",
       "    window._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "\n",
       "  \n",
       "  if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    window._bokeh_timeout = Date.now() + 5000;\n",
       "    window._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    if (window.Bokeh !== undefined) {\n",
       "      var el = document.getElementById(\"7c9e02b2-b27e-4a15-9c45-db68e6883ecd\");\n",
       "      el.textContent = \"BokehJS \" + Bokeh.version + \" successfully loaded.\";\n",
       "    } else if (Date.now() < window._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function run_callbacks() {\n",
       "    window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    delete window._bokeh_onload_callbacks\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    window._bokeh_onload_callbacks.push(callback);\n",
       "    if (window._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    window._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        window._bokeh_is_loading--;\n",
       "        if (window._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };var element = document.getElementById(\"7c9e02b2-b27e-4a15-9c45-db68e6883ecd\");\n",
       "  if (element == null) {\n",
       "    console.log(\"Bokeh: ERROR: autoload.js configured with elementid '7c9e02b2-b27e-4a15-9c45-db68e6883ecd' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "      document.getElementById(\"7c9e02b2-b27e-4a15-9c45-db68e6883ecd\").textContent = \"BokehJS is loading...\";\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((window.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i](window.Bokeh);\n",
       "      }if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < window._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!window._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      window._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"7c9e02b2-b27e-4a15-9c45-db68e6883ecd\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (window._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(this));"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <div class=\"bk-plotdiv\" id=\"746799ae-c857-4c9f-a5d1-38af7efe4dba\"></div>\n",
       "    </div>\n",
       "<script type=\"text/javascript\">\n",
       "  \n",
       "  (function(global) {\n",
       "    function now() {\n",
       "      return new Date();\n",
       "    }\n",
       "  \n",
       "    var force = false;\n",
       "  \n",
       "    if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "      window._bokeh_onload_callbacks = [];\n",
       "      window._bokeh_is_loading = undefined;\n",
       "    }\n",
       "  \n",
       "  \n",
       "    \n",
       "    if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "      window._bokeh_timeout = Date.now() + 0;\n",
       "      window._bokeh_failed_load = false;\n",
       "    }\n",
       "  \n",
       "    var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "       \"<div style='background-color: #fdd'>\\n\"+\n",
       "       \"<p>\\n\"+\n",
       "       \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "       \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "       \"</p>\\n\"+\n",
       "       \"<ul>\\n\"+\n",
       "       \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "       \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "       \"</ul>\\n\"+\n",
       "       \"<code>\\n\"+\n",
       "       \"from bokeh.resources import INLINE\\n\"+\n",
       "       \"output_notebook(resources=INLINE)\\n\"+\n",
       "       \"</code>\\n\"+\n",
       "       \"</div>\"}};\n",
       "  \n",
       "    function display_loaded() {\n",
       "      if (window.Bokeh !== undefined) {\n",
       "        var el = document.getElementById(\"746799ae-c857-4c9f-a5d1-38af7efe4dba\");\n",
       "        el.textContent = \"BokehJS \" + Bokeh.version + \" successfully loaded.\";\n",
       "      } else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(display_loaded, 100)\n",
       "      }\n",
       "    }\n",
       "  \n",
       "    function run_callbacks() {\n",
       "      window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "      delete window._bokeh_onload_callbacks\n",
       "      console.info(\"Bokeh: all callbacks have finished\");\n",
       "    }\n",
       "  \n",
       "    function load_libs(js_urls, callback) {\n",
       "      window._bokeh_onload_callbacks.push(callback);\n",
       "      if (window._bokeh_is_loading > 0) {\n",
       "        console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "        return null;\n",
       "      }\n",
       "      if (js_urls == null || js_urls.length === 0) {\n",
       "        run_callbacks();\n",
       "        return null;\n",
       "      }\n",
       "      console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "      window._bokeh_is_loading = js_urls.length;\n",
       "      for (var i = 0; i < js_urls.length; i++) {\n",
       "        var url = js_urls[i];\n",
       "        var s = document.createElement('script');\n",
       "        s.src = url;\n",
       "        s.async = false;\n",
       "        s.onreadystatechange = s.onload = function() {\n",
       "          window._bokeh_is_loading--;\n",
       "          if (window._bokeh_is_loading === 0) {\n",
       "            console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "            run_callbacks()\n",
       "          }\n",
       "        };\n",
       "        s.onerror = function() {\n",
       "          console.warn(\"failed to load library \" + url);\n",
       "        };\n",
       "        console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      }\n",
       "    };var element = document.getElementById(\"746799ae-c857-4c9f-a5d1-38af7efe4dba\");\n",
       "    if (element == null) {\n",
       "      console.log(\"Bokeh: ERROR: autoload.js configured with elementid '746799ae-c857-4c9f-a5d1-38af7efe4dba' but no matching script tag was found. \")\n",
       "      return false;\n",
       "    }\n",
       "  \n",
       "    var js_urls = [];\n",
       "  \n",
       "    var inline_js = [\n",
       "      function(Bokeh) {\n",
       "        (function() {\n",
       "          var fn = function() {\n",
       "            var docs_json = {\"81339810-5ac5-427a-8edd-2ac84251e1cd\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null},\"id\":\"afcd9980-381a-4e58-8b61-1b428c26ef4f\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"aa194efc-c556-40e7-9b05-6196d50aa8d3\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8598f8ba-afb2-49f8-a1ec-571719099934\",\"type\":\"BasicTicker\"}},\"id\":\"74c9b7d6-e94e-4921-b89f-2b0b1f3bd36f\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"b6f729d3-a474-4928-aa66-37492d393425\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"f1a8b267-6ee7-4068-8007-e7e6a7eb2a47\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"bf5f31a0-e7f2-4544-bd0c-d558dc862aef\",\"type\":\"BasicTicker\"}},\"id\":\"b0bca024-4167-4c52-9198-730970e4a724\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"bf5f31a0-e7f2-4544-bd0c-d558dc862aef\",\"type\":\"BasicTicker\"}},\"id\":\"ca229eab-4073-43fc-961d-c65eba7bc7c2\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d4ba388c-fda1-4f53-afe2-8b02e1e6eba7\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]}},\"id\":\"29105a83-2a7d-42f6-b13f-2d2e78fd98c7\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8598f8ba-afb2-49f8-a1ec-571719099934\",\"type\":\"BasicTicker\"}},\"id\":\"1465406c-c146-4722-b1d0-888e21f582a8\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"29105a83-2a7d-42f6-b13f-2d2e78fd98c7\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d4ba388c-fda1-4f53-afe2-8b02e1e6eba7\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1885604e-613c-455b-9614-74364be69626\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"6937a4a2-370c-4b09-9f4b-6a2817e15b0d\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"aa194efc-c556-40e7-9b05-6196d50aa8d3\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"plot\":{\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"c0901a7b-04b8-4882-8959-e60fee0cf820\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"8598f8ba-afb2-49f8-a1ec-571719099934\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"bd208487-fff1-4275-acf4-9668c9587251\",\"type\":\"ToolEvents\"},{\"attributes\":{},\"id\":\"bf5f31a0-e7f2-4544-bd0c-d558dc862aef\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"f1a8b267-6ee7-4068-8007-e7e6a7eb2a47\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1885604e-613c-455b-9614-74364be69626\",\"type\":\"Line\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"c0901a7b-04b8-4882-8959-e60fee0cf820\",\"type\":\"HoverTool\"}]},\"id\":\"b784e03b-b8bb-43e1-a1b5-9a903161ae0d\",\"type\":\"Toolbar\"},{\"attributes\":{\"below\":[{\"id\":\"b0bca024-4167-4c52-9198-730970e4a724\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"74c9b7d6-e94e-4921-b89f-2b0b1f3bd36f\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"b0bca024-4167-4c52-9198-730970e4a724\",\"type\":\"LinearAxis\"},{\"id\":\"ca229eab-4073-43fc-961d-c65eba7bc7c2\",\"type\":\"Grid\"},{\"id\":\"74c9b7d6-e94e-4921-b89f-2b0b1f3bd36f\",\"type\":\"LinearAxis\"},{\"id\":\"1465406c-c146-4722-b1d0-888e21f582a8\",\"type\":\"Grid\"},{\"id\":\"6937a4a2-370c-4b09-9f4b-6a2817e15b0d\",\"type\":\"GlyphRenderer\"}],\"title\":null,\"tool_events\":{\"id\":\"bd208487-fff1-4275-acf4-9668c9587251\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"b784e03b-b8bb-43e1-a1b5-9a903161ae0d\",\"type\":\"Toolbar\"},\"toolbar_location\":\"below\",\"x_range\":{\"id\":\"afcd9980-381a-4e58-8b61-1b428c26ef4f\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"b6f729d3-a474-4928-aa66-37492d393425\",\"type\":\"DataRange1d\"}},\"id\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\",\"subtype\":\"Figure\",\"type\":\"Plot\"}],\"root_ids\":[\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.5\"}};\n",
       "            var render_items = [{\"docid\":\"81339810-5ac5-427a-8edd-2ac84251e1cd\",\"elementid\":\"746799ae-c857-4c9f-a5d1-38af7efe4dba\",\"modelid\":\"0826e0dc-9fb4-4393-815f-e8c136b7e93b\"}];\n",
       "            \n",
       "            Bokeh.embed.embed_items(docs_json, render_items);\n",
       "          };\n",
       "          if (document.readyState != \"loading\") fn();\n",
       "          else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "        })();\n",
       "      },\n",
       "      function(Bokeh) {\n",
       "      }\n",
       "    ];\n",
       "  \n",
       "    function run_inline_js() {\n",
       "      \n",
       "      if ((window.Bokeh !== undefined) || (force === true)) {\n",
       "        for (var i = 0; i < inline_js.length; i++) {\n",
       "          inline_js[i](window.Bokeh);\n",
       "        }if (force === true) {\n",
       "          display_loaded();\n",
       "        }} else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(run_inline_js, 100);\n",
       "      } else if (!window._bokeh_failed_load) {\n",
       "        console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "        window._bokeh_failed_load = true;\n",
       "      } else if (force !== true) {\n",
       "        var cell = $(document.getElementById(\"746799ae-c857-4c9f-a5d1-38af7efe4dba\")).parents('.cell').data().cell;\n",
       "        cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "      }\n",
       "  \n",
       "    }\n",
       "  \n",
       "    if (window._bokeh_is_loading === 0) {\n",
       "      console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "      run_inline_js();\n",
       "    } else {\n",
       "      load_libs(js_urls, function() {\n",
       "        console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "        run_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }(this));\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <div class=\"bk-plotdiv\" id=\"065f9fa3-714b-43b4-bdd0-d61f064b9f81\"></div>\n",
       "    </div>\n",
       "<script type=\"text/javascript\">\n",
       "  \n",
       "  (function(global) {\n",
       "    function now() {\n",
       "      return new Date();\n",
       "    }\n",
       "  \n",
       "    var force = false;\n",
       "  \n",
       "    if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "      window._bokeh_onload_callbacks = [];\n",
       "      window._bokeh_is_loading = undefined;\n",
       "    }\n",
       "  \n",
       "  \n",
       "    \n",
       "    if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "      window._bokeh_timeout = Date.now() + 0;\n",
       "      window._bokeh_failed_load = false;\n",
       "    }\n",
       "  \n",
       "    var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "       \"<div style='background-color: #fdd'>\\n\"+\n",
       "       \"<p>\\n\"+\n",
       "       \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "       \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "       \"</p>\\n\"+\n",
       "       \"<ul>\\n\"+\n",
       "       \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "       \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "       \"</ul>\\n\"+\n",
       "       \"<code>\\n\"+\n",
       "       \"from bokeh.resources import INLINE\\n\"+\n",
       "       \"output_notebook(resources=INLINE)\\n\"+\n",
       "       \"</code>\\n\"+\n",
       "       \"</div>\"}};\n",
       "  \n",
       "    function display_loaded() {\n",
       "      if (window.Bokeh !== undefined) {\n",
       "        var el = document.getElementById(\"065f9fa3-714b-43b4-bdd0-d61f064b9f81\");\n",
       "        el.textContent = \"BokehJS \" + Bokeh.version + \" successfully loaded.\";\n",
       "      } else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(display_loaded, 100)\n",
       "      }\n",
       "    }\n",
       "  \n",
       "    function run_callbacks() {\n",
       "      window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "      delete window._bokeh_onload_callbacks\n",
       "      console.info(\"Bokeh: all callbacks have finished\");\n",
       "    }\n",
       "  \n",
       "    function load_libs(js_urls, callback) {\n",
       "      window._bokeh_onload_callbacks.push(callback);\n",
       "      if (window._bokeh_is_loading > 0) {\n",
       "        console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "        return null;\n",
       "      }\n",
       "      if (js_urls == null || js_urls.length === 0) {\n",
       "        run_callbacks();\n",
       "        return null;\n",
       "      }\n",
       "      console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "      window._bokeh_is_loading = js_urls.length;\n",
       "      for (var i = 0; i < js_urls.length; i++) {\n",
       "        var url = js_urls[i];\n",
       "        var s = document.createElement('script');\n",
       "        s.src = url;\n",
       "        s.async = false;\n",
       "        s.onreadystatechange = s.onload = function() {\n",
       "          window._bokeh_is_loading--;\n",
       "          if (window._bokeh_is_loading === 0) {\n",
       "            console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "            run_callbacks()\n",
       "          }\n",
       "        };\n",
       "        s.onerror = function() {\n",
       "          console.warn(\"failed to load library \" + url);\n",
       "        };\n",
       "        console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      }\n",
       "    };var element = document.getElementById(\"065f9fa3-714b-43b4-bdd0-d61f064b9f81\");\n",
       "    if (element == null) {\n",
       "      console.log(\"Bokeh: ERROR: autoload.js configured with elementid '065f9fa3-714b-43b4-bdd0-d61f064b9f81' but no matching script tag was found. \")\n",
       "      return false;\n",
       "    }\n",
       "  \n",
       "    var js_urls = [];\n",
       "  \n",
       "    var inline_js = [\n",
       "      function(Bokeh) {\n",
       "        (function() {\n",
       "          var fn = function() {\n",
       "            var docs_json = {\"1f6f83ff-9d41-4e03-997e-b311d22cccce\":{\"roots\":{\"references\":[{\"attributes\":{\"formatter\":{\"id\":\"065dd535-9be2-44bf-b077-5d1a2c19375e\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"97ee31ac-9631-47da-8359-99c3b581bf16\",\"type\":\"BasicTicker\"}},\"id\":\"2597f254-7204-4119-9e9e-711545fa7e87\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"97ee31ac-9631-47da-8359-99c3b581bf16\",\"type\":\"BasicTicker\"}},\"id\":\"0796ec93-7f69-44c9-ae49-589ba748834d\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"614f7647-0538-475a-847d-81307253d2cd\",\"type\":\"ToolEvents\"},{\"attributes\":{\"data_source\":{\"id\":\"61c827a3-0c2f-43b7-884e-a7c523a976f5\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a66d3147-1d7e-4268-b955-2d89da2d49f4\",\"type\":\"MultiLine\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1fe0e572-be06-4578-a748-5e532b4edcb0\",\"type\":\"MultiLine\"},\"selection_glyph\":null},\"id\":\"46cc52ac-48a6-4f8d-b6c6-1eac9b16f145\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2d2a8d35-278b-46b4-9541-0388c17875e3\",\"type\":\"BasicTicker\"}},\"id\":\"f2103140-a619-4fe0-9cbc-0cf0d66ebd13\",\"type\":\"Grid\"},{\"attributes\":{\"below\":[{\"id\":\"44fedea3-d9b5-475c-b0cf-2816f7ee6349\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"2597f254-7204-4119-9e9e-711545fa7e87\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"44fedea3-d9b5-475c-b0cf-2816f7ee6349\",\"type\":\"LinearAxis\"},{\"id\":\"f2103140-a619-4fe0-9cbc-0cf0d66ebd13\",\"type\":\"Grid\"},{\"id\":\"2597f254-7204-4119-9e9e-711545fa7e87\",\"type\":\"LinearAxis\"},{\"id\":\"0796ec93-7f69-44c9-ae49-589ba748834d\",\"type\":\"Grid\"},{\"id\":\"46cc52ac-48a6-4f8d-b6c6-1eac9b16f145\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2c29b16d-280e-4cfd-b261-0c5336c48054\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"614f7647-0538-475a-847d-81307253d2cd\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"92b2756d-69e1-41c0-b469-4526552e863d\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"5410f58c-13ce-4965-a1f7-6fc44b35d3dd\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"184452ad-4aab-4715-8cf0-5c92f4e795d8\",\"type\":\"DataRange1d\"}},\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"2c29b16d-280e-4cfd-b261-0c5336c48054\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"plot\":{\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"2576be11-6c83-484d-a804-5133742830c5\",\"type\":\"HoverTool\"},{\"attributes\":{\"callback\":null},\"id\":\"184452ad-4aab-4715-8cf0-5c92f4e795d8\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"5410f58c-13ce-4965-a1f7-6fc44b35d3dd\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2576be11-6c83-484d-a804-5133742830c5\",\"type\":\"HoverTool\"}]},\"id\":\"92b2756d-69e1-41c0-b469-4526552e863d\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_color\":{\"field\":\"line_color\"},\"line_width\":{\"value\":2},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"a66d3147-1d7e-4268-b955-2d89da2d49f4\",\"type\":\"MultiLine\"},{\"attributes\":{\"formatter\":{\"id\":\"bd315984-3dfb-483d-b974-b797b21abd2f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ceda5041-f765-43b3-8945-5ff38e051366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2d2a8d35-278b-46b4-9541-0388c17875e3\",\"type\":\"BasicTicker\"}},\"id\":\"44fedea3-d9b5-475c-b0cf-2816f7ee6349\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"97ee31ac-9631-47da-8359-99c3b581bf16\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1fe0e572-be06-4578-a748-5e532b4edcb0\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"065dd535-9be2-44bf-b077-5d1a2c19375e\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"bd315984-3dfb-483d-b974-b797b21abd2f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2d2a8d35-278b-46b4-9541-0388c17875e3\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"ys\",\"xs\",\"line_color\"],\"data\":{\"line_color\":[\"firebrick\",\"navy\"],\"xs\":[[1,3,2],[3,4,6,6]],\"ys\":[[2,1,4],[4,7,8,5]]}},\"id\":\"61c827a3-0c2f-43b7-884e-a7c523a976f5\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"ceda5041-f765-43b3-8945-5ff38e051366\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.5\"}};\n",
       "            var render_items = [{\"docid\":\"1f6f83ff-9d41-4e03-997e-b311d22cccce\",\"elementid\":\"065f9fa3-714b-43b4-bdd0-d61f064b9f81\",\"modelid\":\"ceda5041-f765-43b3-8945-5ff38e051366\"}];\n",
       "            \n",
       "            Bokeh.embed.embed_items(docs_json, render_items);\n",
       "          };\n",
       "          if (document.readyState != \"loading\") fn();\n",
       "          else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "        })();\n",
       "      },\n",
       "      function(Bokeh) {\n",
       "      }\n",
       "    ];\n",
       "  \n",
       "    function run_inline_js() {\n",
       "      \n",
       "      if ((window.Bokeh !== undefined) || (force === true)) {\n",
       "        for (var i = 0; i < inline_js.length; i++) {\n",
       "          inline_js[i](window.Bokeh);\n",
       "        }if (force === true) {\n",
       "          display_loaded();\n",
       "        }} else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(run_inline_js, 100);\n",
       "      } else if (!window._bokeh_failed_load) {\n",
       "        console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "        window._bokeh_failed_load = true;\n",
       "      } else if (force !== true) {\n",
       "        var cell = $(document.getElementById(\"065f9fa3-714b-43b4-bdd0-d61f064b9f81\")).parents('.cell').data().cell;\n",
       "        cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "      }\n",
       "  \n",
       "    }\n",
       "  \n",
       "    if (window._bokeh_is_loading === 0) {\n",
       "      console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "      run_inline_js();\n",
       "    } else {\n",
       "      load_libs(js_urls, function() {\n",
       "        console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "        run_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }(this));\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from bokeh.palettes import Spectral11\n",
    "from bokeh.plotting import figure, show, output_notebook, output_file\n",
    "from bokeh.models import HoverTool\n",
    "\n",
    "output_notebook()\n",
    "\n",
    "# create a new plot with the toolbar below\n",
    "p = figure(plot_width=400, plot_height=400,\n",
    "           title=None, toolbar_location=\"below\",\n",
    "           tools='hover')\n",
    "\n",
    "p.line([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], line_width=2)\n",
    "show(p)\n",
    "\n",
    "p = figure(plot_width=400, plot_height=400, tools='hover')\n",
    "\n",
    "p.multi_line([[1, 3, 2], [3, 4, 6, 6]], [[2, 1, 4], [4, 7, 8, 5]],\n",
    "             color=[\"firebrick\", \"navy\"], \n",
    "#              alpha=[0.8, 0.3], \n",
    "             line_width=2)\n",
    "\n",
    "show(p)"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
