Skip to content

Instantly share code, notes, and snippets.

@rutj3
Created November 29, 2016 15:01
Show Gist options
  • Save rutj3/bdaec5f2115ec9b4e38c5230d9a311ac to your computer and use it in GitHub Desktop.
Save rutj3/bdaec5f2115ec9b4e38c5230d9a311ac to your computer and use it in GitHub Desktop.
bokeh_broken_bar
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"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=\"9301dada-7455-49a6-a287-8144efabce77\">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 = \"1\";\n",
"\n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
"\n",
"\n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\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",
" Bokeh.$(\"#9301dada-7455-49a6-a287-8144efabce77\").text(\"BokehJS 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(\"9301dada-7455-49a6-a287-8144efabce77\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '9301dada-7455-49a6-a287-8144efabce77' 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.3.min.js', 'https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.js'];\n",
"\n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.set_log_level(\"info\");\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" \n",
" Bokeh.$(\"#9301dada-7455-49a6-a287-8144efabce77\").text(\"BokehJS is loading...\");\n",
" },\n",
" function(Bokeh) {\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css\");\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css\");\n",
" }\n",
" ];\n",
"\n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\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) {\n",
" var cell = $(\"#9301dada-7455-49a6-a287-8144efabce77\").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"
}
],
"source": [
"import numpy as np\n",
"from bokeh.plotting import figure\n",
"from bokeh.io import output_notebook, show\n",
"from bokeh.palettes import Accent3 as colors\n",
"\n",
"output_notebook()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"a808d2f1-dbb0-44ed-91a4-fde70494f6b3\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\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",
" Bokeh.$(\"#a808d2f1-dbb0-44ed-91a4-fde70494f6b3\").text(\"BokehJS 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(\"a808d2f1-dbb0-44ed-91a4-fde70494f6b3\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'a808d2f1-dbb0-44ed-91a4-fde70494f6b3' 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",
" Bokeh.$(function() {\n",
" var docs_json = {\"1036cd86-3ed1-4d94-a6ba-68d116797f73\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"bb70b457-863b-4412-8142-a5d9c457fb9f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"4d383fc3-da55-4443-955e-8a732a8d4c20\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d75dd333-eae6-4d01-b277-c49774c200c1\",\"type\":\"Quad\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"a1c81c5a-40ab-44ce-9d25-5159c1722206\",\"type\":\"Quad\"},\"selection_glyph\":null},\"id\":\"f3642363-da68-440b-8c71-c8d75eae4828\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"84a377ae-a0d8-4e88-bf0d-db443bc29a1e\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"right\",\"left\"],\"data\":{\"left\":[3,5,8,12,16,18,22,25,28],\"right\":[5,8,12,15,18,21,25,28,31]}},\"id\":\"4d383fc3-da55-4443-955e-8a732a8d4c20\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"25bf4050-a010-4689-ab27-64e92a68290a\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"b5e61a38-4bb7-4fc9-a98a-2758fa2d99d2\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":500,\"renderers\":[{\"id\":\"25bf4050-a010-4689-ab27-64e92a68290a\",\"type\":\"LinearAxis\"},{\"id\":\"7a46be5e-9067-4f2f-ad25-f2425770dd52\",\"type\":\"Grid\"},{\"id\":\"b5e61a38-4bb7-4fc9-a98a-2758fa2d99d2\",\"type\":\"LinearAxis\"},{\"id\":\"b0ce5246-356f-44d1-bc2e-7c017eb8ebb2\",\"type\":\"Grid\"},{\"id\":\"685333be-e3fd-4d40-8659-a8ca4ad7822d\",\"type\":\"BoxAnnotation\"},{\"id\":\"c88a7b00-0ea7-45ac-9b5d-77c5efb73b40\",\"type\":\"Legend\"},{\"id\":\"f3642363-da68-440b-8c71-c8d75eae4828\",\"type\":\"GlyphRenderer\"},{\"id\":\"185ca1bc-9c1e-4ac7-83c5-0a8b609b186b\",\"type\":\"GlyphRenderer\"},{\"id\":\"f9baa887-60b1-432d-b75f-307dc2d23791\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"ce04bccd-851d-4166-a25e-ac828931c4e4\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"92318961-58a0-46a7-b80e-50bc9c7651ae\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"95f35fc7-9aee-4699-8dbe-0756816a5d57\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"f52c894f-d8c0-4369-adba-995689f0be75\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"6c0a9755-8b24-45ae-875e-7edabc06172e\",\"type\":\"DataRange1d\"}},\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom\":{\"value\":1},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"left\":{\"field\":\"left\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":1.8}},\"id\":\"63dc10a2-a1af-4502-8d15-9ebc8a3e6019\",\"type\":\"Quad\"},{\"attributes\":{\"bottom\":{\"value\":0},\"fill_color\":{\"value\":\"#7fc97f\"},\"left\":{\"field\":\"left\"},\"line_color\":{\"value\":\"#7fc97f\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":0.8}},\"id\":\"d75dd333-eae6-4d01-b277-c49774c200c1\",\"type\":\"Quad\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"right\",\"left\"],\"data\":{\"left\":[3,5,8,12,15,17,21,24,27],\"right\":[4,7,12,15,16,20,23,27,29]}},\"id\":\"c93d79da-5443-43af-8e6b-3548544f011e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"formatter\":{\"id\":\"27c3ab20-44c1-428d-a31f-a78d83225198\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d7a53c5d-efe1-4fca-892f-cc44ba15454d\",\"type\":\"BasicTicker\"}},\"id\":\"25bf4050-a010-4689-ab27-64e92a68290a\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d7a53c5d-efe1-4fca-892f-cc44ba15454d\",\"type\":\"BasicTicker\"}},\"id\":\"7a46be5e-9067-4f2f-ad25-f2425770dd52\",\"type\":\"Grid\"},{\"attributes\":{\"label\":{\"value\":\"#7fc97f\"},\"renderers\":[{\"id\":\"f3642363-da68-440b-8c71-c8d75eae4828\",\"type\":\"GlyphRenderer\"}]},\"id\":\"17963f93-045f-4399-acc1-9cc8cabf0164\",\"type\":\"LegendItem\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"84a377ae-a0d8-4e88-bf0d-db443bc29a1e\",\"type\":\"BasicTicker\"}},\"id\":\"b0ce5246-356f-44d1-bc2e-7c017eb8ebb2\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"92318961-58a0-46a7-b80e-50bc9c7651ae\",\"type\":\"ToolEvents\"},{\"attributes\":{\"bottom\":{\"value\":2},\"fill_color\":{\"value\":\"#fdc086\"},\"left\":{\"field\":\"left\"},\"line_color\":{\"value\":\"#fdc086\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":2.8}},\"id\":\"099a1aed-c0c8-43a0-ac8a-4b39b6e40db4\",\"type\":\"Quad\"},{\"attributes\":{\"bottom\":{\"value\":1},\"fill_color\":{\"value\":\"#beaed4\"},\"left\":{\"field\":\"left\"},\"line_color\":{\"value\":\"#beaed4\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":1.8}},\"id\":\"0aa1f224-3179-47a4-b3db-34f693a898eb\",\"type\":\"Quad\"},{\"attributes\":{\"data_source\":{\"id\":\"c93d79da-5443-43af-8e6b-3548544f011e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"0aa1f224-3179-47a4-b3db-34f693a898eb\",\"type\":\"Quad\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"63dc10a2-a1af-4502-8d15-9ebc8a3e6019\",\"type\":\"Quad\"},\"selection_glyph\":null},\"id\":\"185ca1bc-9c1e-4ac7-83c5-0a8b609b186b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"27c3ab20-44c1-428d-a31f-a78d83225198\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"d7a53c5d-efe1-4fca-892f-cc44ba15454d\",\"type\":\"BasicTicker\"},{\"attributes\":{\"items\":[{\"id\":\"17963f93-045f-4399-acc1-9cc8cabf0164\",\"type\":\"LegendItem\"},{\"id\":\"49cc3a93-3c7c-4c03-8f11-38658e16bb85\",\"type\":\"LegendItem\"},{\"id\":\"55a4e78d-8f6b-4efb-a6d3-be8f10d86ba0\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"c88a7b00-0ea7-45ac-9b5d-77c5efb73b40\",\"type\":\"Legend\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"cf999afd-43b7-44d2-927e-ce4103fb9d8b\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"right\",\"left\"],\"data\":{\"left\":[3,6,10,13,17,20,23,25,28],\"right\":[6,9,13,16,19,23,25,28,31]}},\"id\":\"0ea229c8-b9ae-49ab-946a-29310d694b70\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":null},\"id\":\"ce04bccd-851d-4166-a25e-ac828931c4e4\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"685333be-e3fd-4d40-8659-a8ca4ad7822d\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null},\"id\":\"f52c894f-d8c0-4369-adba-995689f0be75\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom\":{\"value\":2},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"left\":{\"field\":\"left\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":2.8}},\"id\":\"fcdb22b2-4de2-4e7c-92e6-29f33be131ba\",\"type\":\"Quad\"},{\"attributes\":{\"overlay\":{\"id\":\"685333be-e3fd-4d40-8659-a8ca4ad7822d\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"d3a07a14-3ebf-4928-82eb-5134e82c39f9\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"9685d85b-7f73-40ec-a2b5-fe81eb7a138b\",\"type\":\"SaveTool\"},{\"attributes\":{\"formatter\":{\"id\":\"bb70b457-863b-4412-8142-a5d9c457fb9f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"84a377ae-a0d8-4e88-bf0d-db443bc29a1e\",\"type\":\"BasicTicker\"}},\"id\":\"b5e61a38-4bb7-4fc9-a98a-2758fa2d99d2\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom\":{\"value\":0},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"left\":{\"field\":\"left\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"right\"},\"top\":{\"value\":0.8}},\"id\":\"a1c81c5a-40ab-44ce-9d25-5159c1722206\",\"type\":\"Quad\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"ac95be57-744a-4b01-8974-675597a611ea\",\"type\":\"HelpTool\"},{\"attributes\":{\"label\":{\"value\":\"#fdc086\"},\"renderers\":[{\"id\":\"f9baa887-60b1-432d-b75f-307dc2d23791\",\"type\":\"GlyphRenderer\"}]},\"id\":\"55a4e78d-8f6b-4efb-a6d3-be8f10d86ba0\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"19641849-eee2-4933-8e47-09628b322870\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null},\"id\":\"6c0a9755-8b24-45ae-875e-7edabc06172e\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"0ea229c8-b9ae-49ab-946a-29310d694b70\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"099a1aed-c0c8-43a0-ac8a-4b39b6e40db4\",\"type\":\"Quad\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"fcdb22b2-4de2-4e7c-92e6-29f33be131ba\",\"type\":\"Quad\"},\"selection_glyph\":null},\"id\":\"f9baa887-60b1-432d-b75f-307dc2d23791\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"5f4f0894-da2a-4df7-87ba-946cd75bcf9a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"label\":{\"value\":\"#beaed4\"},\"renderers\":[{\"id\":\"185ca1bc-9c1e-4ac7-83c5-0a8b609b186b\",\"type\":\"GlyphRenderer\"}]},\"id\":\"49cc3a93-3c7c-4c03-8f11-38658e16bb85\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"cf999afd-43b7-44d2-927e-ce4103fb9d8b\",\"type\":\"PanTool\"},{\"id\":\"5f4f0894-da2a-4df7-87ba-946cd75bcf9a\",\"type\":\"WheelZoomTool\"},{\"id\":\"d3a07a14-3ebf-4928-82eb-5134e82c39f9\",\"type\":\"BoxZoomTool\"},{\"id\":\"9685d85b-7f73-40ec-a2b5-fe81eb7a138b\",\"type\":\"SaveTool\"},{\"id\":\"19641849-eee2-4933-8e47-09628b322870\",\"type\":\"ResetTool\"},{\"id\":\"ac95be57-744a-4b01-8974-675597a611ea\",\"type\":\"HelpTool\"}]},\"id\":\"95f35fc7-9aee-4699-8dbe-0756816a5d57\",\"type\":\"Toolbar\"}],\"root_ids\":[\"ab48af21-d8ad-4af1-baf2-cbee736350f5\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"1036cd86-3ed1-4d94-a6ba-68d116797f73\",\"elementid\":\"a808d2f1-dbb0-44ed-91a4-fde70494f6b3\",\"modelid\":\"ab48af21-d8ad-4af1-baf2-cbee736350f5\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\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) {\n",
" var cell = $(\"#a808d2f1-dbb0-44ed-91a4-fde70494f6b3\").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": [
"p = figure(height=300, width=500)\n",
"\n",
"for n, color in enumerate(colors):\n",
" \n",
" bottom = n\n",
" top = n+.8\n",
" \n",
" left = np.random.randint(2,5,10).cumsum()\n",
" right = left[:-1] + np.diff(left) - np.random.randint(0,2,9)\n",
" left = left[:-1]\n",
" \n",
" p.quad(top=top, bottom=bottom, left=left, right=right, color=color, legend=color)\n",
" \n",
"show(p)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment