{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lesson 20: High level plotting\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\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", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"1001\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) {\n", " if (callback != null)\n", " callback();\n", " });\n", " } finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.debug(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(css_urls, js_urls, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = css_urls.length + js_urls.length;\n", "\n", " function on_load() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n", " run_callbacks()\n", " }\n", " }\n", "\n", " function on_error() {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (var i = 0; i < css_urls.length; i++) {\n", " var url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.rel = \"stylesheet\";\n", " element.type = \"text/css\";\n", " element.href = url;\n", " console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n", " document.body.appendChild(element);\n", " }\n", "\n", " const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js\": \"ufR9RFnRs6lniiaFvtJziE0YeidtAgBRH6ux2oUItHw5WTvE1zuk9uzhUU/FJXDp\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js\": \"8QM/PGWBT+IssZuRcDcjzwIh1mkOmJSoNMmyYDZbCfXJg3Ap1lEvdVgFuSAwhb/J\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js\": \"Jm8cH3Rg0P6UeZhVY5cLy1WzKajUT9KImCY+76hEqrcJt59/d8GPvFHjCkYgnSIn\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.2.min.js\": \"Ozhzj+SI7ywm74aOI/UajcWz+C0NjsPunEVyVIrxzYkB+jA+2tUw8x5xJCbVtK5I\"};\n", "\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " if (url in hashes) {\n", " element.crossOrigin = \"anonymous\";\n", " element.integrity = \"sha384-\" + hashes[url];\n", " }\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " };\n", "\n", " function inject_raw_css(css) {\n", " const element = document.createElement(\"style\");\n", " element.appendChild(document.createTextNode(css));\n", " document.body.appendChild(element);\n", " }\n", "\n", " \n", " var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.2.min.js\"];\n", " var css_urls = [];\n", " \n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " function(Bokeh) {\n", " \n", " \n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if (root.Bokeh !== undefined || force === true) {\n", " \n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }\n", " if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(css_urls, js_urls, function() {\n", " console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1001\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js\": \"ufR9RFnRs6lniiaFvtJziE0YeidtAgBRH6ux2oUItHw5WTvE1zuk9uzhUU/FJXDp\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js\": \"8QM/PGWBT+IssZuRcDcjzwIh1mkOmJSoNMmyYDZbCfXJg3Ap1lEvdVgFuSAwhb/J\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js\": \"Jm8cH3Rg0P6UeZhVY5cLy1WzKajUT9KImCY+76hEqrcJt59/d8GPvFHjCkYgnSIn\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.2.min.js\": \"Ozhzj+SI7ywm74aOI/UajcWz+C0NjsPunEVyVIrxzYkB+jA+2tUw8x5xJCbVtK5I\"};\n\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "import bokeh_catplot\n", "\n", "import bokeh.plotting\n", "import bokeh.io\n", "\n", "bokeh.io.output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "In this lesson, do some plotting with a high-level package [Bokeh-catplot](https://github.com/justinbois/bokeh-catplot). You should have installed it in [Lesson 0](l00_configuring_your_computer.ipynb).\n", "\n", "We will use [the frog tongue data set from Kleinteich and Gorb](https://doi.org/10.1038/srep05225) that we used in our exercises with Pandas. Let's get the data frame loaded in so we can be on our way." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dateIDtrial numberimpact force (mN)impact time (ms)impact force / body weightadhesive force (mN)time frog pulls on target (ms)adhesive force / body weightadhesive impulse (N-s)total contact area (mm2)contact area without mucus (mm2)contact area with mucus / contact area without mucuscontact pressure (Pa)adhesive strength (Pa)
02013_02_26I31205461.95-7858841.27-0.290387700.823117-2030
12013_02_26I42527444.08-9832481.59-0.181101940.0724923-9695
22013_03_01I11745342.82-8502111.37-0.15783790.0521020-10239
32013_03_01I21556412.51-45510250.74-0.1703301580.524718-1381
42013_03_01I3493360.80-9744991.57-0.4232452160.122012-3975
\n", "
" ], "text/plain": [ " date ID trial number impact force (mN) impact time (ms) \\\n", "0 2013_02_26 I 3 1205 46 \n", "1 2013_02_26 I 4 2527 44 \n", "2 2013_03_01 I 1 1745 34 \n", "3 2013_03_01 I 2 1556 41 \n", "4 2013_03_01 I 3 493 36 \n", "\n", " impact force / body weight adhesive force (mN) \\\n", "0 1.95 -785 \n", "1 4.08 -983 \n", "2 2.82 -850 \n", "3 2.51 -455 \n", "4 0.80 -974 \n", "\n", " time frog pulls on target (ms) adhesive force / body weight \\\n", "0 884 1.27 \n", "1 248 1.59 \n", "2 211 1.37 \n", "3 1025 0.74 \n", "4 499 1.57 \n", "\n", " adhesive impulse (N-s) total contact area (mm2) \\\n", "0 -0.290 387 \n", "1 -0.181 101 \n", "2 -0.157 83 \n", "3 -0.170 330 \n", "4 -0.423 245 \n", "\n", " contact area without mucus (mm2) \\\n", "0 70 \n", "1 94 \n", "2 79 \n", "3 158 \n", "4 216 \n", "\n", " contact area with mucus / contact area without mucus \\\n", "0 0.82 \n", "1 0.07 \n", "2 0.05 \n", "3 0.52 \n", "4 0.12 \n", "\n", " contact pressure (Pa) adhesive strength (Pa) \n", "0 3117 -2030 \n", "1 24923 -9695 \n", "2 21020 -10239 \n", "3 4718 -1381 \n", "4 2012 -3975 " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv('data/frog_tongue_adhesion.csv', comment='#')\n", "\n", "# Have a look so we remember\n", "df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## High level plotting and rendering with Bokeh\n", "\n", "[HoloViews](https://holoviews.org/) is an excellent high-level plotting package that can use Bokeh to render plots. In my view, it is one of the best high-level plotting packages in the Python plotting landscape. We will work with HoloViews in a future lesson, but in this lesson, we will do our high-level plotting using a package I wrote called [Bokeh-catplot](https://github.com/justinbois/bokeh-catplot).\n", "\n", "Why are we using this package and not HoloViews? In next year's bootcamp, I am almost certain we will use HoloViews exclusively for high-level plotting because I suspect that most of the functionality in Bokeh-catplot will be incorporated into HoloViews. Bokeh-catplot exists because HoloViews lacks some important functionality. (More on these very important plot types in a moment; don't worry if you don't know what they are just yet.)\n", "\n", "- It does not natively make ECDFs, [but will eventually](https://github.com/holoviz/holoviews/issues/3821). I'm actually the one who should do this, and my apologies for not having it done.\n", "- It does not (easily, or as far as I can tell) enable an axis with more than one categorical variable for strip plots (though it does for box plots).\n", "\n", "There are all relatively minor fixes for HoloViews, which will likely have this functionality in the near future.\n", "\n", "Nonetheless, ECDFs and horizontal strip plots are important visualizations and I advocate using them often, and Bokeh-catplot provides a high-level way to render them using Bokeh." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plots with categorical variables\n", "\n", "Let us first consider the different kinds of data we may encounter as we think about constructing a plot.\n", "\n", "- **Quantitative** data may have continuously varying (and therefore ordered) values.\n", "- **Categorical** data has discrete, unordered values that a variable can take.\n", "- **Ordinal** data has discrete, ordered values. Integers are a classic example.\n", "- **Temporal** data refers to time, which can be represented as dates.\n", "\n", "In practice, ordinal data can be cast as quantitative or treated as categorical with an ordering enforced on the categories (e.g., categorical data `[1, 2, 3]` becomes `['1', '2', '3']`.). Temporal data can also be cast as quantitative, (e.g., second from the start time). We will therefore focus out attention on quantitative and categorical data.\n", "\n", "When we made scatter plots in the previous lesson, both types of data were quantitative. We did actually incorporate categorical information in the form of colors of the glyph (insomniacs and normal sleepers being colored differently) and in tooltips. \n", "\n", "But what if we wanted a single type of measurement, say impact force, for each frog? Here, we have the quantitative impact force data and the categorical frog ID data. One of our axes is now categorical." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Bar graph\n", "\n", "To demonstrate how to set up a categorical axis with Bokeh, I will make a bar graph of the mean impact force for each of the four frogs. But before I even begin this, I will give you the following piece of advice: *Don't make bar graphs.* More on that in a moment.\n", "\n", "Before we do that, we need to compute the means from the inputted data frame." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDimpact force (mN)
0I1530.20
1II707.35
2III550.10
3IV419.10
\n", "
" ], "text/plain": [ " ID impact force (mN)\n", "0 I 1530.20\n", "1 II 707.35\n", "2 III 550.10\n", "3 IV 419.10" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mean = df.groupby('ID')['impact force (mN)'].mean().reset_index()\n", "\n", "# Take a look\n", "df_mean" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To set up a categorical axis, you need to specify the `x_range` (or `y_range` if you want the y-axis to be categorical) as a list with the categories you want on the axis when you instantiate the figure. I will make a horizontal bar graph, so I will specify `y_range`. Also, when I instantiate this figure, because it is not very tall and I do not want the reset tool cut off, I will also explicitly set the tools I want in the toolbar." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "p = bokeh.plotting.figure(\n", " frame_height=200,\n", " frame_width=400,\n", " x_axis_label='impact force (mN)',\n", " y_range=df_mean['ID'].unique()[::-1],\n", " tools='pan,wheel_zoom,save,reset'\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we have the figure, we can put the bars on. The `p.hbar()` method populates the figure with horizontal bar glyphs. The `right` kwarg says what column of the data source dictates how far to the right to show the bar, while the `height` kwarg says how think the bars are.\n", "\n", "I will also ensure the quantitative axis starts at zero and turn off the grid lines on the categorical axis, which is commonly done." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"596dd724-508f-4659-a854-caaea882e306\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1011\"}],\"center\":[{\"id\":\"1014\"},{\"id\":\"1017\"}],\"frame_height\":200,\"frame_width\":400,\"left\":[{\"id\":\"1015\"}],\"renderers\":[{\"id\":\"1031\"}],\"title\":{\"id\":\"1033\"},\"toolbar\":{\"id\":\"1022\"},\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1007\"},\"y_range\":{\"id\":\"1005\"},\"y_scale\":{\"id\":\"1009\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.6},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"ID\"}},\"id\":\"1030\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1027\"},\"glyph\":{\"id\":\"1029\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1030\"},\"selection_glyph\":null,\"view\":{\"id\":\"1032\"}},\"id\":\"1031\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1038\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.6},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"ID\"}},\"id\":\"1029\",\"type\":\"HBar\"},{\"attributes\":{\"axis\":{\"id\":\"1011\"},\"ticker\":null},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"1005\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"start\":0},\"id\":\"1003\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1018\"},{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1021\"}]},\"id\":\"1022\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"1036\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1017\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1027\"}},\"id\":\"1032\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1018\",\"type\":\"PanTool\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1038\"},\"ticker\":{\"id\":\"1012\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1033\",\"type\":\"Title\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"II\",\"III\",\"IV\"],\"impact force (mN)\":{\"__ndarray__\":\"zczMzMzol0DNzMzMzBqGQM3MzMzMMIFAmpmZmZkxekA=\",\"dtype\":\"float64\",\"shape\":[4]},\"index\":[0,1,2,3]},\"selected\":{\"id\":\"1039\"},\"selection_policy\":{\"id\":\"1040\"}},\"id\":\"1027\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1040\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"formatter\":{\"id\":\"1036\"},\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1039\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"WheelZoomTool\"}],\"root_ids\":[\"1002\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"596dd724-508f-4659-a854-caaea882e306\",\"root_ids\":[\"1002\"],\"roots\":{\"1002\":\"6fe6f55e-5555-4d3a-8925-2ab603e7b0db\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1002" } }, "output_type": "display_data" } ], "source": [ "p.hbar(\n", " source=df_mean,\n", " y='ID',\n", " right='impact force (mN)',\n", " height=0.6\n", ")\n", "\n", "# Turn off gridlines on categorical axis\n", "p.ygrid.grid_line_color = None\n", "\n", "# Start axes at origin on quantitative axis\n", "p.x_range.start = 0\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We similarly make vertical bar graphs specifying `x_range` and using `p.vbar()`." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"9be974ed-2e25-4855-9f2e-f8db29c46b77\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1098\"}],\"center\":[{\"id\":\"1100\"},{\"id\":\"1104\"}],\"frame_height\":250,\"frame_width\":250,\"left\":[{\"id\":\"1101\"}],\"renderers\":[{\"id\":\"1123\"}],\"title\":{\"id\":\"1133\"},\"toolbar\":{\"id\":\"1112\"},\"x_range\":{\"id\":\"1090\"},\"x_scale\":{\"id\":\"1094\"},\"y_range\":{\"id\":\"1092\"},\"y_scale\":{\"id\":\"1096\"}},\"id\":\"1089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1099\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1136\"},\"ticker\":{\"id\":\"1102\"}},\"id\":\"1101\",\"type\":\"LinearAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1133\",\"type\":\"Title\"},{\"attributes\":{\"axis\":{\"id\":\"1101\"},\"dimension\":1,\"ticker\":null},\"id\":\"1104\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1119\"}},\"id\":\"1124\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"1098\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"1100\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1109\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"impact force (mN)\"},\"width\":{\"value\":0.6},\"x\":{\"field\":\"ID\"}},\"id\":\"1122\",\"type\":\"VBar\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"II\",\"III\",\"IV\"],\"impact force (mN)\":{\"__ndarray__\":\"zczMzMzol0DNzMzMzBqGQM3MzMzMMIFAmpmZmZkxekA=\",\"dtype\":\"float64\",\"shape\":[4]},\"index\":[0,1,2,3]},\"selected\":{\"id\":\"1139\"},\"selection_policy\":{\"id\":\"1140\"}},\"id\":\"1119\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1105\",\"type\":\"PanTool\"},{\"attributes\":{\"start\":0},\"id\":\"1092\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1108\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1136\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1110\",\"type\":\"HelpTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1111\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"impact force (mN)\"},\"width\":{\"value\":0.6},\"x\":{\"field\":\"ID\"}},\"id\":\"1121\",\"type\":\"VBar\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"1090\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1139\",\"type\":\"Selection\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1105\"},{\"id\":\"1106\"},{\"id\":\"1107\"},{\"id\":\"1108\"},{\"id\":\"1109\"},{\"id\":\"1110\"}]},\"id\":\"1112\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1138\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1140\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1096\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1138\"},\"ticker\":{\"id\":\"1099\"}},\"id\":\"1098\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1102\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1094\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1106\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1119\"},\"glyph\":{\"id\":\"1121\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1122\"},\"selection_glyph\":null,\"view\":{\"id\":\"1124\"}},\"id\":\"1123\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"1111\"}},\"id\":\"1107\",\"type\":\"BoxZoomTool\"}],\"root_ids\":[\"1089\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"9be974ed-2e25-4855-9f2e-f8db29c46b77\",\"root_ids\":[\"1089\"],\"roots\":{\"1089\":\"a0aa5d0d-9cd7-499a-8cd5-1837c42fafb9\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1089" } }, "output_type": "display_data" } ], "source": [ "p = bokeh.plotting.figure(\n", " frame_height=250,\n", " frame_width=250,\n", " y_axis_label='impact force (mN)',\n", " x_range=df_mean['ID'].unique(),\n", ")\n", "\n", "p.vbar(\n", " source=df_mean,\n", " x='ID',\n", " top='impact force (mN)',\n", " width=0.6\n", ")\n", "\n", "p.xgrid.grid_line_color = None\n", "p.y_range.start = 0\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Bokeh-catplot\n", "\n", "Generating the bar graphs was not too painful, even tough we used Bokeh, a low-level plotting library. We would like to make plots more **declaratively**. We do not want to have to explicitly pre-process the data, set up the categorical axis, etc. We would like to just provide a data set, say which column(s) is/are categorical and which is quantitative, and then just get our plot. As I mentioned before, Holoviews is excellent for this purpose, but we will use Bokeh-catplot as our high-level package for making plots for now.\n", "\n", "Bokeh-catplot generates plots from tidy data frames where one or more columns contains categorical data and the column of interest in the plot is quantitative.\n", "\n", "There are four types of plots that Bokeh-catplot can generate. As you will see, all four of these modes of plotting are meant to give a picture about how the quantitative measurements are *distributed* for each category.\n", "\n", "- **Plots with a categorical axis**\n", " + Box plots: `bokeh_catplot.box()`\n", " + Strip plots: `bokeh_catplot.strip()`\n", " \n", " \n", "- **Plots without a categorical axis**\n", " + Histograms: `bokeh_catplot.histogram()`\n", " + [ECDFs](https://en.wikipedia.org/wiki/Empirical_distribution_function): `bokeh_catplot.ecdf()`\n", " \n", "\n", "The first three arguments of each of these functions are necessary to build the plot. They are:\n", "\n", "- `data`: A tidy data frame\n", "- `cats`: A list of columns in the data frame that are to be considered as categorical variables in the plot. If `None`, a single box, strip, histogram, or ECDF is plotted.\n", "- `val`: The column of the data frame to be treated as the quantitative variable. \n", "\n", "With this in mind, we will put Bokeh-catplot to use on the frog data set." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Box plots with Bokeh-catplot\n", "\n", "As I [discuss below](#Don't-make-bar-graphs), bar graphs are almost never a good choice for visualization. You distill all of the information in the data set down to one or two summary statistics, and then use giant glyphs to show them. As a start for improvement, you could distill the data set down to five or so summary statistics and show those graphically, as opposed to just one or two. \n", "\n", "Box plots provide such a summary. I will first make one using `bokeh_catplot.box()` and then describe how a box plot is interpreted." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"b83a5174-a092-4cc2-9519-e14d3d485afc\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1205\"}],\"center\":[{\"id\":\"1207\"},{\"id\":\"1211\"}],\"left\":[{\"id\":\"1208\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1234\"},{\"id\":\"1239\"},{\"id\":\"1244\"},{\"id\":\"1249\"},{\"id\":\"1254\"}],\"title\":{\"id\":\"1273\"},\"toolbar\":{\"id\":\"1219\"},\"x_range\":{\"id\":\"1196\"},\"x_scale\":{\"id\":\"1201\"},\"y_range\":{\"id\":\"1199\"},\"y_scale\":{\"id\":\"1203\"}},\"id\":\"1197\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1212\",\"type\":\"PanTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"1238\",\"type\":\"Segment\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"1228\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data_source\":{\"id\":\"1226\"},\"glyph\":{\"id\":\"1242\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1243\"},\"selection_glyph\":null,\"view\":{\"id\":\"1245\"}},\"id\":\"1244\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1212\"},{\"id\":\"1213\"},{\"id\":\"1214\"},{\"id\":\"1215\"},{\"id\":\"1216\"},{\"id\":\"1217\"}]},\"id\":\"1219\",\"type\":\"Toolbar\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1248\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"1213\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"1237\",\"type\":\"Segment\"},{\"attributes\":{\"overlay\":{\"id\":\"1218\"}},\"id\":\"1214\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1280\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1201\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1215\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1282\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1199\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1216\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"1233\",\"type\":\"Segment\"},{\"attributes\":{\"data\":{\"__label\":[\"I\",\"II\",\"III\",\"IV\"],\"bottom\":[1231.25,422.0,458.75,198.0],\"bottom_whisker\":[473.0,245.0,324.0,22.0],\"cat\":[\"I\",\"II\",\"III\",\"IV\"],\"middle\":[1550.5,573.0,544.0,460.5],\"top\":[1904.75,799.75,615.75,599.0],\"top_whisker\":[2641.0,1182.0,806.0,815.0]},\"selected\":{\"id\":\"1279\"},\"selection_policy\":{\"id\":\"1280\"}},\"id\":\"1226\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1226\"}},\"id\":\"1240\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1230\"}},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1242\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"1226\"}},\"id\":\"1235\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1228\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1229\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"1252\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1279\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1218\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1203\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1227\"}},\"id\":\"1255\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1226\"},\"glyph\":{\"id\":\"1237\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1238\"},\"selection_glyph\":null,\"view\":{\"id\":\"1240\"}},\"id\":\"1239\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"formatter\":{\"id\":\"1278\"},\"ticker\":{\"id\":\"1206\"}},\"id\":\"1205\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"1226\"},\"glyph\":{\"id\":\"1232\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1233\"},\"selection_glyph\":null,\"view\":{\"id\":\"1235\"}},\"id\":\"1234\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1226\"},\"glyph\":{\"id\":\"1247\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1248\"},\"selection_glyph\":null,\"view\":{\"id\":\"1250\"}},\"id\":\"1249\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1227\"},\"glyph\":{\"id\":\"1252\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1253\"},\"selection_glyph\":null,\"view\":{\"id\":\"1255\"}},\"id\":\"1254\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1209\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1206\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"1232\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1217\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1281\",\"type\":\"Selection\"},{\"attributes\":{\"axis\":{\"id\":\"1205\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"1207\",\"type\":\"Grid\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"1196\",\"type\":\"FactorRange\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1247\",\"type\":\"VBar\"},{\"attributes\":{\"axis\":{\"id\":\"1208\"},\"dimension\":1,\"ticker\":null},\"id\":\"1211\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1278\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1226\"}},\"id\":\"1250\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"1281\"},\"selection_policy\":{\"id\":\"1282\"}},\"id\":\"1227\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1276\"},\"ticker\":{\"id\":\"1209\"}},\"id\":\"1208\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1228\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1229\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"1253\",\"type\":\"Circle\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1230\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1243\",\"type\":\"VBar\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1273\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"1226\"}},\"id\":\"1245\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"1229\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"1276\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"1230\",\"type\":\"CategoricalColorMapper\"}],\"root_ids\":[\"1197\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"b83a5174-a092-4cc2-9519-e14d3d485afc\",\"root_ids\":[\"1197\"],\"roots\":{\"1197\":\"440da2b3-a040-475e-8b00-85c42a23aaa7\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1197" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.box(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)'\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The line in the middle of each box is the median and the top and bottom of the box at the 75th and 25th percentiles, respectively. The distance between the 25th and 75th percentiles is called the **interquartile range**, or IQR. The whiskers of the box plot extend to the most extreme data point within 1.5 times the interquartile range. If any data points are more extreme than the end of the whisker, they are shown individually, and are often referred to as _outliers_.\n", "\n", "A box plot can use a useful visualization if you have many data points and it is difficult to plot them all. I rarely find that there are situations where all data cannot be plotted, either with strip plots of ECDFs, which we will cover in a moment, so I generally do not use box plots. Nonetheless, I do not find them too objectionable, as they effectively display important nonparametric summary statistics of your data set." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot all your data\n", "\n", "Box plots summarize a data set with summary statistics, but what not plot all your data? You work hard to acquire them. You should show them all. This is a mantra to live by.\n", "\n", "
\n", " \n", "Plot all of your data.\n", " \n", "
\n", "\n", "Let's do that now." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Strip plots\n", "\n", "A **strip plot** is like a scatter plot; it puts a glyph for every measured data point. The only difference is that one of the axes is categorical. In this case, you are plotting all of your data." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"f8fc9597-7650-4683-b443-6f3162d09385\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1359\"}],\"center\":[{\"id\":\"1361\"},{\"id\":\"1365\"}],\"left\":[{\"id\":\"1362\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1385\"}],\"title\":{\"id\":\"1415\"},\"toolbar\":{\"id\":\"1373\"},\"x_range\":{\"id\":\"1350\"},\"x_scale\":{\"id\":\"1355\"},\"y_range\":{\"id\":\"1353\"},\"y_scale\":{\"id\":\"1357\"}},\"id\":\"1351\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1420\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"1380\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"1366\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1367\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1418\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"1372\"}},\"id\":\"1368\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1372\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1355\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1369\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1353\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1370\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1421\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1371\",\"type\":\"HelpTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1415\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1380\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1380\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"1383\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1357\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"1381\"},\"glyph\":{\"id\":\"1383\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1384\"},\"selection_glyph\":null,\"view\":{\"id\":\"1386\"}},\"id\":\"1385\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1366\"},{\"id\":\"1367\"},{\"id\":\"1368\"},{\"id\":\"1369\"},{\"id\":\"1370\"},{\"id\":\"1371\"}]},\"id\":\"1373\",\"type\":\"Toolbar\"},{\"attributes\":{\"formatter\":{\"id\":\"1420\"},\"ticker\":{\"id\":\"1360\"}},\"id\":\"1359\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1363\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1360\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"source\":{\"id\":\"1381\"}},\"id\":\"1386\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"1350\",\"type\":\"FactorRange\"},{\"attributes\":{\"axis\":{\"id\":\"1359\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"1361\",\"type\":\"Grid\"},{\"attributes\":{\"axis\":{\"id\":\"1362\"},\"dimension\":1,\"ticker\":null},\"id\":\"1365\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1380\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1380\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"1384\",\"type\":\"Circle\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1418\"},\"ticker\":{\"id\":\"1363\"}},\"id\":\"1362\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1422\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"cat\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473,1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730,614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488,172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468]},\"selected\":{\"id\":\"1421\"},\"selection_policy\":{\"id\":\"1422\"}},\"id\":\"1381\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1351\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"f8fc9597-7650-4683-b443-6f3162d09385\",\"root_ids\":[\"1351\"],\"roots\":{\"1351\":\"707dc6f3-0a89-42a5-80cd-a1779cbba080\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1351" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)'\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is a good plot to make since you are plotting all of your data, but it does have the problem that you cannot tell if multiple data points overlap." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Histograms\n", "\n", "In plotting all of our data in a strip plot, we can roughly see how the data are distributed. There are more measurements where there are more glyphs. We ofter seek to visualize the *distribution* of the data. **Histograms** are commonly used for this. They are typically interpreted to as an empirical representation of the probability density function." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"9a485094-eaf2-484c-9006-847d1a86ceb7\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1487\"}],\"center\":[{\"id\":\"1490\"},{\"id\":\"1494\"},{\"id\":\"1521\"}],\"left\":[{\"id\":\"1491\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1512\"},{\"id\":\"1526\"},{\"id\":\"1540\"},{\"id\":\"1557\"},{\"id\":\"1575\"},{\"id\":\"1596\"},{\"id\":\"1618\"},{\"id\":\"1643\"}],\"title\":{\"id\":\"1514\"},\"toolbar\":{\"id\":\"1502\"},\"x_range\":{\"id\":\"1480\"},\"x_scale\":{\"id\":\"1483\"},\"y_range\":{\"id\":\"1478\"},\"y_scale\":{\"id\":\"1485\"}},\"id\":\"1479\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1556\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1500\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1495\"},{\"id\":\"1496\"},{\"id\":\"1497\"},{\"id\":\"1498\"},{\"id\":\"1499\"},{\"id\":\"1500\"}]},\"id\":\"1502\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1488\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"1512\"},{\"id\":\"1526\"}]},\"id\":\"1522\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis\":{\"id\":\"1491\"},\"dimension\":1,\"ticker\":null},\"id\":\"1494\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"1554\"},\"glyph\":{\"id\":\"1555\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1556\"},\"selection_glyph\":null,\"view\":{\"id\":\"1558\"}},\"id\":\"1557\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1724\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1522\"},{\"id\":\"1553\"},{\"id\":\"1592\"},{\"id\":\"1639\"}]},\"id\":\"1521\",\"type\":\"Legend\"},{\"attributes\":{\"start\":0},\"id\":\"1478\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1555\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1570\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1495\",\"type\":\"PanTool\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1538\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1492\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"1517\"},\"ticker\":{\"id\":\"1492\"}},\"id\":\"1491\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQDMzMzMzM4BAMzMzMzMzgEBmZmZmZr6IQGZmZmZmvohAzMzMzMykkEDMzMzMzKSQQGZmZmZm6pRAZmZmZmbqlEAAAAAAADCZQAAAAAAAMJlA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAgQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAcQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAACEAAAAAAAAAIQAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"1569\"},\"selection_policy\":{\"id\":\"1570\"}},\"id\":\"1537\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis\":{\"id\":\"1487\"},\"ticker\":null},\"id\":\"1490\",\"type\":\"Grid\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"1575\"},{\"id\":\"1596\"}]},\"id\":\"1592\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1517\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1589\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1590\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QFVVVVVV5XFAVVVVVVXlcUBVVVVVVTWBQFVVVVVVNYFAAAAAAAB4iUAAAAAAAHiJQA==\",\"dtype\":\"float64\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAcQAAAAAAAABxAAAAAAAAAGEAAAAAAAAAYQAAAAAAAABxAAAAAAAAAHEAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[8]}},\"selected\":{\"id\":\"1663\"},\"selection_policy\":{\"id\":\"1664\"}},\"id\":\"1615\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1572\"},\"glyph\":{\"id\":\"1573\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1574\"},\"selection_glyph\":null,\"view\":{\"id\":\"1576\"}},\"id\":\"1575\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQDMzMzMzM4BAMzMzMzMzgEBmZmZmZr6IQGZmZmZmvohAzMzMzMykkEDMzMzMzKSQQGZmZmZm6pRAZmZmZmbqlEAAAAAAADCZQAAAAAAAMJlAAAAAAAAwmUAAAAAAAKBuQA==\",\"dtype\":\"float64\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAgQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAcQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAACEAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[14]}},\"selected\":{\"id\":\"1589\"},\"selection_policy\":{\"id\":\"1590\"}},\"id\":\"1554\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1498\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1485\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1499\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1519\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1572\"}},\"id\":\"1576\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1483\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1480\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"1501\"}},\"id\":\"1497\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1496\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1519\"},\"ticker\":{\"id\":\"1488\"}},\"id\":\"1487\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"1615\"}},\"id\":\"1619\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"1540\"},{\"id\":\"1557\"}]},\"id\":\"1553\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QGZmZmZmRnpAZmZmZmZGekBmZmZmZiaAQGZmZmZmJoBAmpmZmZkpg0CamZmZmSmDQM3MzMzMLIZAzczMzMwshkAAAAAAADCJQAAAAAAAMIlAAAAAAAAwiUAAAAAAAEB0QA==\",\"dtype\":\"float64\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAUQAAAAAAAABRAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[14]}},\"selected\":{\"id\":\"1636\"},\"selection_policy\":{\"id\":\"1637\"}},\"id\":\"1593\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1594\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"1593\"}},\"id\":\"1597\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1554\"}},\"id\":\"1558\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1550\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1537\"}},\"id\":\"1541\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1524\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1593\"},\"glyph\":{\"id\":\"1594\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1595\"},\"selection_glyph\":null,\"view\":{\"id\":\"1597\"}},\"id\":\"1596\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1574\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1612\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1615\"},\"glyph\":{\"id\":\"1616\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1617\"},\"selection_glyph\":null,\"view\":{\"id\":\"1619\"}},\"id\":\"1618\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#2ba02b\",\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1595\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1551\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1569\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1613\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1535\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1636\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1617\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"1618\"},{\"id\":\"1643\"}]},\"id\":\"1639\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1637\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"1523\"}},\"id\":\"1527\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QFVVVVVV5XFAVVVVVVXlcUBVVVVVVTWBQFVVVVVVNYFAAAAAAAB4iUAAAAAAAHiJQAAAAAAAeIlAAAAAAAAANkA=\",\"dtype\":\"float64\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAcQAAAAAAAABxAAAAAAAAAGEAAAAAAAAAYQAAAAAAAABxAAAAAAAAAHEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[10]}},\"selected\":{\"id\":\"1723\"},\"selection_policy\":{\"id\":\"1724\"}},\"id\":\"1640\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1573\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1525\",\"type\":\"Patch\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1641\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"1640\"}},\"id\":\"1644\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1640\"},\"glyph\":{\"id\":\"1641\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1642\"},\"selection_glyph\":null,\"view\":{\"id\":\"1644\"}},\"id\":\"1643\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1663\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1511\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#d62628\",\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1642\",\"type\":\"Patch\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1539\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1664\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1534\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1514\",\"type\":\"Title\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QM3MzMzMVIxAzczMzMxUjEDNzMzMzPCUQM3MzMzM8JRANDMzMzO3m0A0MzMzM7ebQM3MzMzMPqFAzczMzMw+oUAAAAAAAKKkQAAAAAAAoqRAAAAAAACipEAAAAAAAJB9QA==\",\"dtype\":\"float64\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[14]}},\"selected\":{\"id\":\"1550\"},\"selection_policy\":{\"id\":\"1551\"}},\"id\":\"1523\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1510\",\"type\":\"Line\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1501\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"1537\"},\"glyph\":{\"id\":\"1538\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1539\"},\"selection_glyph\":null,\"view\":{\"id\":\"1541\"}},\"id\":\"1540\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QGZmZmZmRnpAZmZmZmZGekBmZmZmZiaAQGZmZmZmJoBAmpmZmZkpg0CamZmZmSmDQM3MzMzMLIZAzczMzMwshkAAAAAAADCJQAAAAAAAMIlA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAUQAAAAAAAABRAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"1612\"},\"selection_policy\":{\"id\":\"1613\"}},\"id\":\"1572\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1509\"}},\"id\":\"1513\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QM3MzMzMVIxAzczMzMxUjEDNzMzMzPCUQM3MzMzM8JRANDMzMzO3m0A0MzMzM7ebQM3MzMzMPqFAzczMzMw+oUAAAAAAAKKkQAAAAAAAoqRA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"1534\"},\"selection_policy\":{\"id\":\"1535\"}},\"id\":\"1509\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1616\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"1523\"},\"glyph\":{\"id\":\"1524\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1525\"},\"selection_glyph\":null,\"view\":{\"id\":\"1527\"}},\"id\":\"1526\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1509\"},\"glyph\":{\"id\":\"1510\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1511\"},\"selection_glyph\":null,\"view\":{\"id\":\"1513\"}},\"id\":\"1512\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1723\",\"type\":\"Selection\"}],\"root_ids\":[\"1479\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"9a485094-eaf2-484c-9006-847d1a86ceb7\",\"root_ids\":[\"1479\"],\"roots\":{\"1479\":\"3846eba5-653e-4900-bddc-01e1ccb71f15\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1479" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.histogram(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)'\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ECDFs\n", "\n", "I just mentioned that histograms are typically used to display how data are distributed, but it was hard to make out the distributions in the above plot, partly because we do not have very many measurements. As another example I will generate Normally distributed data and plot the histogram. (We will learn how to generate data like this when we study random number generation with NumPy in a future lesson. For not, this is for purposes of discussing plotting options.)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"8ba1d45f-1928-482d-a023-abd0fea49b1d\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1873\"}],\"center\":[{\"id\":\"1876\"},{\"id\":\"1880\"},{\"id\":\"1907\"}],\"left\":[{\"id\":\"1877\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1898\"},{\"id\":\"1912\"}],\"title\":{\"id\":\"1900\"},\"toolbar\":{\"id\":\"1888\"},\"x_range\":{\"id\":\"1866\"},\"x_scale\":{\"id\":\"1869\"},\"y_range\":{\"id\":\"1864\"},\"y_scale\":{\"id\":\"1871\"}},\"id\":\"1865\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1991\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1896\",\"type\":\"Line\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1887\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1905\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\" \"},\"renderers\":[{\"id\":\"1898\"},{\"id\":\"1912\"}]},\"id\":\"1908\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1871\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1881\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1992\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"pW4ehO02CMClbh6E7TYIwEdno3d+OwXAR2ejd347BcDpXyhrD0ACwOlfKGsPQALAFrFavUCJ/r8WsVq9QIn+v1qiZKRikvi/WqJkpGKS+L+ek26LhJvyv56TbouEm/K/xAnx5ExJ6b/ECfHkTEnpv5jYCWYht9q/mNgJZiG32r9A7YwRSN2mv0DtjBFI3aa/SJ2mYc//1D9InaZhz//UPxxsv+KjbeY/HGy/4qNt5j/KxFUKsC3xP8rEVQqwLfE/htNLI44k9z+G00sjjiT3P0LiQTxsG/0/QuJBPGwb/T9/+JsqJYkBQH/4myoliQFA3f8WN5SEBEDd/xY3lIQEQDwHkkMDgAdAPAeSQwOAB0A=\",\"dtype\":\"float64\",\"shape\":[34]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAACZAAAAAAAAAJkAAAAAAAAAzQAAAAAAAADNAAAAAAAAAP0AAAAAAAAA/QAAAAAAAAElAAAAAAAAASUAAAAAAAABKQAAAAAAAAEpAAAAAAACAT0AAAAAAAIBPQAAAAAAAgFFAAAAAAACAUUAAAAAAAABOQAAAAAAAAE5AAAAAAACASkAAAAAAAIBKQAAAAAAAgEJAAAAAAACAQkAAAAAAAAA3QAAAAAAAADdAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[34]}},\"selected\":{\"id\":\"1920\"},\"selection_policy\":{\"id\":\"1921\"}},\"id\":\"1895\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1882\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1921\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1869\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1910\",\"type\":\"Patch\"},{\"attributes\":{\"overlay\":{\"id\":\"1887\"}},\"id\":\"1883\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1903\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"1903\"},\"ticker\":{\"id\":\"1878\"}},\"id\":\"1877\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1884\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1866\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1897\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1885\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1920\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1895\"},\"glyph\":{\"id\":\"1896\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1897\"},\"selection_glyph\":null,\"view\":{\"id\":\"1899\"}},\"id\":\"1898\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1886\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"1905\"},\"ticker\":{\"id\":\"1874\"}},\"id\":\"1873\",\"type\":\"LinearAxis\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1881\"},{\"id\":\"1882\"},{\"id\":\"1883\"},{\"id\":\"1884\"},{\"id\":\"1885\"},{\"id\":\"1886\"}]},\"id\":\"1888\",\"type\":\"Toolbar\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"pW4ehO02CMClbh6E7TYIwEdno3d+OwXAR2ejd347BcDpXyhrD0ACwOlfKGsPQALAFrFavUCJ/r8WsVq9QIn+v1qiZKRikvi/WqJkpGKS+L+ek26LhJvyv56TbouEm/K/xAnx5ExJ6b/ECfHkTEnpv5jYCWYht9q/mNgJZiG32r9A7YwRSN2mv0DtjBFI3aa/SJ2mYc//1D9InaZhz//UPxxsv+KjbeY/HGy/4qNt5j/KxFUKsC3xP8rEVQqwLfE/htNLI44k9z+G00sjjiT3P0LiQTxsG/0/QuJBPGwb/T9/+JsqJYkBQH/4myoliQFA3f8WN5SEBEDd/xY3lIQEQDwHkkMDgAdAPAeSQwOAB0A8B5JDA4AHQKVuHoTtNgjA\",\"dtype\":\"float64\",\"shape\":[36]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAACZAAAAAAAAAJkAAAAAAAAAzQAAAAAAAADNAAAAAAAAAP0AAAAAAAAA/QAAAAAAAAElAAAAAAAAASUAAAAAAAABKQAAAAAAAAEpAAAAAAACAT0AAAAAAAIBPQAAAAAAAgFFAAAAAAACAUUAAAAAAAABOQAAAAAAAAE5AAAAAAACASkAAAAAAAIBKQAAAAAAAgEJAAAAAAACAQkAAAAAAAAA3QAAAAAAAADdAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[36]}},\"selected\":{\"id\":\"1991\"},\"selection_policy\":{\"id\":\"1992\"}},\"id\":\"1909\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"items\":[{\"id\":\"1908\"}],\"visible\":false},\"id\":\"1907\",\"type\":\"Legend\"},{\"attributes\":{\"source\":{\"id\":\"1909\"}},\"id\":\"1913\",\"type\":\"CDSView\"},{\"attributes\":{\"start\":0},\"id\":\"1864\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"1909\"},\"glyph\":{\"id\":\"1910\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1911\"},\"selection_glyph\":null,\"view\":{\"id\":\"1913\"}},\"id\":\"1912\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"1877\"},\"dimension\":1,\"ticker\":null},\"id\":\"1880\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1874\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"1895\"}},\"id\":\"1899\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1911\",\"type\":\"Patch\"},{\"attributes\":{\"axis\":{\"id\":\"1873\"},\"ticker\":null},\"id\":\"1876\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1878\",\"type\":\"BasicTicker\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1900\",\"type\":\"Title\"}],\"root_ids\":[\"1865\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"8ba1d45f-1928-482d-a023-abd0fea49b1d\",\"root_ids\":[\"1865\"],\"roots\":{\"1865\":\"78f546ba-e1c6-4d68-a79c-a3d2c837e23f\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1865" } }, "output_type": "display_data" } ], "source": [ "# Generate normally distributed data\n", "np.random.seed(353926)\n", "df_norm = pd.DataFrame(data={'x': np.random.normal(size=500)})\n", "\n", "# Plot the histogram\n", "p = bokeh_catplot.histogram(\n", " data=df_norm,\n", " cats=None,\n", " val='x'\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This looks similar to the standard Normal curve we are used to seeing and is a useful comparison to a **probability density function** (PDF). However, Histograms suffer from **binning bias**. By binning the data, you are not plotting all of them. In general, if you can **plot all of your data**, you should. For that reason, I prefer not to use histograms for studying how data are distributed, but rather prefer to use ECDFs, which enable plotting of all data.\n", "\n", "The ECDF evaluated at x for a set of measurements is defined as\n", "\n", "\\begin{align}\n", "\\text{ECDF}(x) = \\text{fraction of measurements } \\le x.\n", "\\end{align}\n", "\n", "While the histogram is an attempt to visualize a probability density function (PDF) of a distribution, the ECDF visualizes the **cumulative density function** (CDF). The CDF, $F(x)$, and PDF, $f(x)$, both completely define a univariate distribution and are related by\n", "\n", "\\begin{align}\n", "f(x) = \\frac{\\mathrm{d}F}{\\mathrm{d}x}.\n", "\\end{align}\n", "\n", "The definition of the ECDF is all that you need for interpretation. Once you get used to looking at CDFs, they will become as familiar to you as PDFs. A peak in a PDF corresponds to an inflection point in a CDF.\n", "\n", "To make this more clear, let us look at plot of a PDF and ECDF for familiar distributions, the Gaussian and Binomial.\n", "\n", "
\n", "\n", "![PDF/CDF](pdf_cdf.png)\n", " \n", "
\n", "\n", "Now that we know how to interpret ECDFs, lets plot the ECDF for our dummy Normally-distributed data." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"ba7c7b69-e2d0-46e1-a267-d3a9d5af2449\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2069\"}],\"center\":[{\"id\":\"2072\"},{\"id\":\"2076\"},{\"id\":\"2104\"}],\"left\":[{\"id\":\"2073\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2095\"}],\"title\":{\"id\":\"2097\"},\"toolbar\":{\"id\":\"2084\"},\"x_range\":{\"id\":\"2061\"},\"x_scale\":{\"id\":\"2065\"},\"y_range\":{\"id\":\"2063\"},\"y_scale\":{\"id\":\"2067\"}},\"id\":\"2060\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2097\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2083\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2077\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2061\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2074\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2100\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2077\"},{\"id\":\"2078\"},{\"id\":\"2079\"},{\"id\":\"2080\"},{\"id\":\"2081\"},{\"id\":\"2082\"}]},\"id\":\"2084\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2078\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"N4lBYOXQ4j8IrBxaZDvfP0w3iUFg5cA/i2zn+6nx0j+F61G4HoXbPwrXo3A9Cuc/qMZLN4lB4D+iRbbz/dToPzvfT42XbpI/EFg5tMh23j+R7Xw/NV7iP0oMAiuHFuE/F9nO91Pj5T/dJAaBlUPrPzm0yHa+n6o/H4XrUbge5T9SuB6F61HIPwaBlUOLbOc/wcqhRbbz7T8CK4cW2c7nP3sUrkfheqQ//Knx0k1i6D9GtvP91HjpP3E9CtejcOU/XrpJDAIr5z8pXI/C9SjcP/p+arx0k5g/6SYxCKwc2j+DwMqhRbbrP+kmMQisHOI/kxgEVg4twj8ZBFYOLbLNPxBYObTIduY/g8DKoUW2wz+cxCCwcmjpP28Sg8DKoe0/I9v5fmq81D9g5dAi2/neP5zEILByaKE/9ihcj8L16D/NzMzMzMzcPxsv3SQGge0/3SQGgZVD4z8zMzMzMzPDP/p+arx0k+A/9P3UeOkm0T8fhetRuB7VP/yp8dJNYoA/WmQ730+N7z/RItv5fmrMPxsv3SQGgaU/+n5qvHSTqD+iRbbz/dTIPzMzMzMzM+M/CtejcD0K7z+amZmZmZnZP4/C9Shcj+I/N4lBYOXQ0j8xCKwcWmTrP6JFtvP91OA/8tJNYhBY6T++nxov3STmPzvfT42XbrI/c2iR7Xw/xT9CYOXQItvhPzvfT42XbsI/4XoUrkfh4j+TGARWDi3SPwisHFpkO78/CtejcD0Ktz8UrkfhehTmPycxCKwcWuw/yXa+nxov5T9Ei2zn+6npPwRWDi2ynd8/F9nO91Pj1T8IrBxaZDvnP4lBYOXQIts/0SLb+X5q5D/0/dR46SbhP0oMAiuHFuk/rkfhehSu7z8ZBFYOLbKtPz81XrpJDOo/w/UoXI/C7T/FILByaJHlPwRWDi2yne8/f2q8dJMY1D8QWDm0yHbOP8uhRbbz/eQ/nu+nxks36T+6SQwCK4fuP9ejcD0K1+s/YOXQItv5zj+Nl24Sg8DqP6rx0k1iELg/2/l+arx04z+wcmiR7XzfP65H4XoUrtc/46WbxCCw0j9YObTIdr6vP8dLN4lBYOU/w/UoXI/C1T/P91PjpZvUPylcj8L1KOw/6SYxCKwcyj9xPQrXo3DdP7gehetRuJ4/sHJoke185z956SYxCKzkP+xRuB6F68E/g8DKoUW20z9kO99PjZfuP2q8dJMYBOY/uB6F61G4zj+F61G4HoXrP/Cnxks3iek/2c73U+Olyz8rhxbZzvfrP+f7qfHSTeo/ZmZmZmZm1j+gGi/dJAbRP5qZmZmZmeE/3SQGgZVD2z8zMzMzMzPTP6RwPQrXo9A/sp3vp8ZLxz+q8dJNYhDgP2IQWDm0yMY/exSuR+F6lD/8qfHSTWKQP/hT46WbxOg/exSuR+F61D8AAAAAAADwP/yp8dJNYuA/UI2XbhKD4D8lBoGVQ4vsP9nO91PjpeM/Gy/dJAaB1T9/arx0kxjkP05iEFg5tNg/8tJNYhBY4T+cxCCwcmjhP0jhehSuR9E/RIts5/up4T9qvHSTGAS2P/Cnxks3idE/FK5H4XoU7j9eukkMAivvPy2yne+nxts/QmDl0CLb2T+yne+nxkvnP6RwPQrXo+g/2c73U+Oluz/6fmq8dJOIP2ZmZmZmZuY/MzMzMzMz6z8MAiuHFtneP+F6FK5H4co/6SYxCKwc6j81XrpJDALbP4ts5/up8bI/CKwcWmQ7zz+BlUOLbOfjP0jhehSuR+E/GQRWDi2y7T9cj8L1KFzfP1pkO99Pjbc/pHA9CtejwD8ZBFYOLbLdP9nO91Pjpes/f2q8dJMY7D8730+Nl27qPx1aZDvfT90/AiuHFtnO7z/P91PjpZvkP/LSTWIQWMk/fT81XrpJ3D9qvHSTGATGP30/NV66SeQ/iUFg5dAi6z9Ei2zn+6nRP7pJDAIrh5Y/Di2yne+n5j8Sg8DKoUXmPy2yne+nxuM/PzVeukkM0j+gGi/dJAbpP1YOLbKd7+c/aJHtfD81vj8730+Nl26iP3sUrkfheuQ/CtejcD0K1z8xCKwcWmTjP+kmMQisHLo/SgwCK4cW2T8OLbKd76fWP9nO91Pjpds/1XjpJjEI7D/hehSuR+HqPzEIrBxaZNs/eekmMQis7D/VeOkmMQjcP3e+nxov3eQ/c2iR7Xw/1T+BlUOLbOfrP8UgsHJoke0/46WbxCCw6j9YObTIdr7PP3sUrkfheoQ/eekmMQisjD/6fmq8dJPIP/7UeOkmMeA/9ihcj8L14D8v3SQGgZXrP2iR7Xw/Nc4/tMh2vp8a7z89CtejcD3qP2IQWDm0yOY/7nw/NV662T8ZBFYOLbK9P+58PzVeuuk/KVyPwvUo5D+0yHa+nxrnP4/C9Shcj+o/ppvEILBy2D956SYxCKysP/hT46WbxOA//Knx0k1iwD+JQWDl0CK7Px+F61G4Hu0/lkOLbOf72T+BlUOLbOfLP7gehetRuL4/ObTIdr6fuj+HFtnO91PjPy2yne+nxus/7nw/NV664T+wcmiR7XzvP/yp8dJNYnA/7FG4HoXr6T8OLbKd76fuP/7UeOkmMeg/30+Nl24S6z9vEoPAyqHlPxKDwMqhRcY/46WbxCCwwj81XrpJDALjP/p+arx0k9g/8tJNYhBY2T9U46WbxCDgPzvfT42XbtI/BoGVQ4ts1z+LbOf7qfHCP76fGi/dJO4/RIts5/upwT/l0CLb+X7qPxSuR+F6FN4//Knx0k1isD9mZmZmZmbuP76fGi/dJNY/GQRWDi2y5T97FK5H4Xq0P7TIdr6fGt8/+n5qvHSTuD9I4XoUrkfpP65H4XoUruc/TmIQWDm04D8AAAAAAADoPzm0yHa+n5o/Gy/dJAaBxT8j2/l+arzkP4XrUbgeheM/mG4Sg8DK4T9GtvP91HjhPycxCKwcWtQ/nu+nxks34T/D9Shcj8LlP+XQItv5fuI/WmQ730+N1z/HSzeJQWDtPxsv3SQGgbU/TmIQWDm06D+TGARWDi3iP7pJDAIrh9Y/aJHtfD817j/jpZvEILDiP7gehetRuO4/YhBYObTI1j/wp8ZLN4nhPwwCK4cW2e4/yXa+nxov7T+BlUOLbOfbP83MzMzMzOQ/JzEIrBxa5D+oxks3iUHoP7pJDAIrh6Y/WmQ730+Nxz+Nl24Sg8DaP1YOLbKd79c/y6FFtvP91D/RItv5fmrsP1g5tMh2vt8/Gy/dJAaB5T8AAAAAAADgP1TjpZvEIOg/IbByaJHt3D/2KFyPwvXYP1yPwvUoXO8/mpmZmZmZyT/4U+Olm8TQP3e+nxov3ew/WmQ730+Npz8hsHJoke3sP8P1KFyPwsU/bef7qfHS5T9WDi2yne/vPzm0yHa+n+o/rBxaZDvf7z/sUbgeheuxP3Noke18P+0/ObTIdr6f2j8K16NwPQrHP4ts5/up8eo/KVyPwvUozD+amZmZmZm5P99PjZduEuM/WDm0yHa+5z8/NV66SQziP1TjpZvEIMA/4XoUrkfh2j/Jdr6fGi/NP23n+6nx0u0//Knx0k1iYD9MN4lBYOXgPwwCK4cW2eY/nu+nxks32T/TTWIQWDnsP2iR7Xw/NeY/30+Nl24S0z+cxCCwcmjBP+XQItv5fto/UrgehetR6D/Jdr6fGi/dP83MzMzMzOw/qvHSTWIQ6D91kxgEVg7dP0a28/3UeNk/CKwcWmQ77z+iRbbz/dTYP/p+arx0k3g/7FG4HoXr4T8v3SQGgZXjP5HtfD81Xso/SgwCK4cWyT/RItv5fmrcP3sUrkfhesQ/uB6F61G45j/ByqFFtvPlP5zEILByaLE/5/up8dJN0j+sHFpkO9/nP0w3iUFg5dA/16NwPQrX4z9QjZduEoPQP7x0kxgEVu4/z/dT46Wb7D8rhxbZzvfDP+f7qfHSTeI/sp3vp8ZL7z+wcmiR7XzPP9V46SYxCOQ/AAAAAAAA0D+6SQwCK4fGPx1aZDvfT+U/JQaBlUOL3D+DwMqhRbbjP7Kd76fGS9c/IbByaJHt5D9SuB6F61HYPyUGgZVDi+Q/qMZLN4lB0D/LoUW28/3EP6wcWmQ7398/BFYOLbKd5z9CYOXQItvpP2q8dJMYBNY/ZDvfT42X3j/b+X5qvHSzP28Sg8DKodU/K4cW2c734z91kxgEVg7lP5zEILByaNE/jZduEoPA4j+6SQwCK4fmP5huEoPAytE/uB6F61G43j9cj8L1KFznP4cW2c73U9M/y6FFtvP9tD+4HoXrUbiuP9v5fmq8dOs/QmDl0CLbyT8j2/l+arzEP2Q730+Nl+Y/XrpJDAIr1z+YbhKDwMrpPy/dJAaBldM/hxbZzvdT6z9qvHSTGATuPyuHFtnO97M/UrgehetR4D9zaJHtfD/lP6abxCCwcug/eekmMQis3D+8dJMYBFbePx1aZDvfT+0/cT0K16Nw7T8Sg8DKoUXWPylcj8L1KLw/eekmMQisvD85tMh2vp/iPzvfT42XbuI/tvP91Hjp5j81XrpJDALrP2Dl0CLb+eY/cT0K16NwzT85tMh2vp/KP23n+6nx0t0/iUFg5dAiyz9QjZduEoPoP6abxCCwcuA/j8L1KFyP0j/6fmq8dJPoP3sUrkfheuw//Knx0k1ioD/ByqFFtvPNP+xRuB6F69E/001iEFg51D9MN4lBYOWwP8HKoUW2890/dZMYBFYO7T/8qfHSTWLQP2Dl0CLb+e4/qvHSTWIQ2D8xCKwcWmTLP30/NV66Sew/iUFg5dAi4z+6SQwCK4e2P1g5tMh2vr8/TDeJQWDl6D/LoUW28/3sP9v5fmq8dMM/PQrXo3A92j8QWDm0yHbuP6rx0k1iEMg/EoPAyqFF7j93vp8aL93UP/T91HjpJsE/2c73U+Olqz8GgZVDi2zvP4ts5/up8eI/SgwCK4cWuT9aZDvfT43nP5HtfD81Xto/PQrXo3A94j/b+X5qvHSjP7bz/dR46dY/AiuHFtnO1z8X2c73U+PtP6AaL90kBuE/WDm0yHa+7z9oke18PzXeP9v5fmq8dNM/I9v5fmq87D9U46WbxCDQP7bz/dR46e4/9P3UeOkm6T+amZmZmZmpP5ZDi2zn++k/xSCwcmiR3T+TGARWDi3qP3npJjEIrMw//tR46SYx2D956SYxCKycP5ZDi2zn++E/K4cW2c730z/Xo3A9CtfTP9NNYhBYOeQ/pHA9Ctej4D9iEFg5tMjuP8dLN4lBYNU/yXa+nxovvT8hsHJoke3MP5HtfD81Xuo/vHSTGARW5j/TTWIQWDnEP5qZmZmZmek/AiuHFtnOxz83iUFg5dDqPw==\",\"dtype\":\"float64\",\"shape\":[500]},\"__dummy_cat\":[\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"],\"__label\":[\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499],\"x\":{\"__ndarray__\":\"Euvk5OO5zT8d29vy4CyFv5ZyEigcqfO/ARHvEAmn47/KZrKm/oHCvztf3qTnJOQ/FFmyjg6Poj9VGD9c9cfpP3SdJI27TQLAlLOHbAqRnb+R3E9lTIrKP9YPQDl2N7Q/ZB71o1Sr4D/FY03HZxnyP6LT5c8pRfy/g/LdYQrZ2z848xMGlnztv0BTAyeAn+Y/1c10h+6U+T9GTgMApGvnP+C1gIGokf6/SojEt1Y16D//DzqgzVPrP+WwPt+mi90/F9exKrtF5T8dgh7Hx3DAvySqTJ3E9gDAHDIBh5w6yr8PTWH3rL7yP0Ao9SmBl8c/NNP2xxh98r++olahgQfqv5Y0HwijceI/amFx5raU8b+l3yUCaSLrP00LTNnC6vg/QuiV8ilG4L8+eZ9D58ySv40q9HBeOADArxhFXVjx6T/ijSdzd8i3v2YkJU9sofg/2jSwjG1A0z8867tf583xvw/oBdYbtKk/jzzjQDsU5r8D2hb3nz3fv9vzyu7YgAbAbI2CjPM0AkD1NhqDWkzqv5tY7+7Jwv2/kMeMM/eu/L+taSO7r0Ttv+SZiaDbjNI/A2Fr++M9AEDNNgz3YjbMvxKqQWfc7cs/WADoXOjH47+VZc1rbmbyP1Vi0alcYrI/mFXOmDQS6z813ANT2FDhP0r9k5gG0/i/mLcYqTax8L/Wi0d59XXEPwnwd8xDP/K/Gp8q+SUu0T80BlX6w23kv1desbRqYfS/0gFrlkd997+vjf/TcDThP76c0MsWr/M/XPe/7EkF3D+HZ6FNWLjsPymvzEDAxTk/JtoqDCMk2793x+3eKHflP5qyxeUsqMW/ZSF2Io492D8QjgohBhi4P0ghOMZNDOo/Dm1eQkjHAkCypSe7S6L6v+ntMsz6Ze4/CuT08GM2+T+jBIKOaazeP+LgGsWmagJAS2lOzhxh4b9UVF5u8rPpvxtoA22ci9o/DNXws1uZ6j+mcZAUWJ38P9FGpJJI0PI/n1DUf6tI6b8Y7aU/JhDxPxax2HO7C/e/ZpCsap4c1D/JrFvJt85ev8NsyV0urNW/tfE/ab7U47/CYv0rWpD6v5QwruE8AN0/FmDzvz0o278rOjpf/MDgv17szev0YPM/9DcBbcQ+7L8Fdu+CiSGzv6Y/9kL/rQDAIMs3UsPk5j9bezok9OLYPyWwsSCqqPK/zrXnGS5o4r+6MawvNQn9Py8f55ab4+A/ehO3DfmX6b+VxrHOqJfyP2z+U2c7bew/lJvoQ1fR6r8xgVjICtfyPwKM2b5jZ+8/gpCVb5he2b+LPgmyBa3mvw0W2Bi+UMA/g4NUrRiyxL/I1kQ1PCHjv0IvaH1LfOe/3xB8PcQV77/Z9xVRRsWaP8DgaIcRuO+/Qe+LQWBGAcAQVL4Q54gCwIXJfKLIoek/qDQPvHHj4L88B5JDA4AHQGVMZKhJC6Q/fwR9T4lKpj9iOwQnQET0P+9Ayob6ytU/D5avA1XD3L/AvyroJFrXPzenS8gaNNK/hjanREKUuD/Ol1SDzhm8P/HTViCj/eW/1TUyWZXvwT8YpEawKuD3v+Tcgv2ZduW/D+aw7LsI+z8pANv4CoEAQNgA2Uz1M8K/yvEEP97My7/p+lvSVd/lP7YIoK5Lxeg/zMqDZYhU9r8nEUlv4V0DwCv/7jOPQOI/kyH0gLn48T8QO3LB0PCSv83gnPBsL+u/odaWMgKW7j84iBjCaE3Gv2iLzz3Z0vi/ZQwUSS876b81+GsIqWXWP5Eo9Mpuhrg//l+Wybrt+D9+sE62GCWDvwNEqwOtd/e/VQUT1bq487+mjj9QP0ivv7c8IpaUrfI/vI7vw6BN8z/B4pF4ahzwPxHSYhbwJbO/oFrQG6AKBEAQKQ/nW9PYP8bM7BlCBe2/2gUsSj5hv78WheNjBx7wv8EfJUjUCtg/AESOdqb38T/mRAAVyjnlvyppyxiWNwHA9eyny04J4z96xYNY7KjhP49zstHn5dU/w8sy2CCJ5L8SX3x7PwrqP5hXqcF3yec/z0i40G2w9L+kRzGi3Wr/vxKaVMRwn9g/sUXch7ft1r+wGaVqwBbUP1H/ketmnva/ayn2AeQk0b/4wOxHpwzYv7HKO/BTUsK/QlVjs1kJ8z+dD89f8TjxPzVzwHcQNMS/WwMSo5n39D9HFQkyubPAv/X4Rt1wSto/P3vQrIYs3r8aTS3hBdXyP8fHoZxS6Pg/IjJZxCmW8D9zA4WzZKnov3bpqNpjagTA1Ar9flPTAsAUVtx4vVvtv1nXJEkBF58/IXbBH7Dksz+No8wuK6zyP2tdFNcZuem/zAKB6RpdAEBpKJvRGUjvP5oaC7bbgeM/OI5uUGPzy7/Hs4Bn0P/0v7T2FPpd0uw/Xe/R0Lmj1z9nmp/0qoXkP5ury7NlNPA/sMfhHzzf079hnURCg+76v3wn7wxavLE/NxQ+9kXs87/ARNyi9V72v+FQ4qVS3fY/8Ib0lK8Hy79SWwwWCKzqv48/ZD4ZevS/aLkb0IRp9r8y8SKY45TTP0ZdKjtTzfI/ZX6vdwnmwz+S5Gs+Zy8CQHq1BMsdVQfAGjYpcTEq7j9a0dlYoCr9P/Ax9mMF6ec/m/Nr+pzx8T/ugL/L3w7fP8TS0igODPC/dRUNSIcO8r+lbcIII8rRPyvPUMEL19K/R3Fr+SB+zL9x/9sZEy6ePwVwHQeS9+O/L6YOjftO1r+Xwcd4Cujxv2i5nwmvTfs/B6bNSHHw8r8DMZ8ApyLwP74ECzCuKqi/tvocTSB/+r/t2RZO0lj8P559bhZOiNq/zIL19e2L3z/4MHnlqYn4v+yW3RsVGpC/PjaGXVT79r8pc9r/BgPrPySbf9wsEuc/bNmK4J50sT/9bYyMDtHnP4bcJHT58QDArnYPZH+j8L+fil+wBu7YP/JbIPBwydQ/OY56BVErxD9YxlcEgiG9P8atehQ88eC/lpooulVtuD8RaL4zC7HfP0pF96H7vMs/413ELp+01b8noGS22FH4PwU/fueFVPi/TW7+plzW6D9K8WDSQ0zIP1NIQRUHYti//0sVUQSF+z+YFB0u5HnNP8M9+dCWZf0/GNeX2Ya517/Rg4rOKsu+P5gZWJCgff4/3zD+Kl5V9z+PkNvquDTBv+XoBb2mX9k/3MK9uS4b2D+ennYfkwboP4NemBJ3pP2/xp9JTs//7r9xA02Uf2zHv6wYenjkf9W/3CiZDK1o37/h/dUSyQL0P28h/IqNO4Q/dLA+xoYq3j+yReAPgZ2TP3CrizCo4ec/uE4bKD/Ttr8W9Gg9rzXRv+S5RiRptQFAjBg/eZ/47L+aEAEnXyLnv+ufZpZIl/U/s4SVmaPz/L8/Js0MkKv1P0YQJaBFH/C/nXMd+Cfn3z+Xt7fE0FsGQMzywlhKgPA/vUl7zbtNBEBUAduWuAD5vwHf9wOyWPc/g/cH47W1yL8G3aOE+ibvvyS5avt+T/E/wyfuhkmE6r8U/xYD89X2v6KU6or12NE/TWGDnBMn5z+LK3/4HSrHP+WpPUR2MPS/1UM4emvnxr/nZPPK3xfqvxNHvvr3Wfk/pW4ehO02CMDXAyJ1/v+yPxS9a/d15OM/7Mvjm0lI0L+eVAnkgn3zPx7aUZh/l+E/ZGn5VqZq47/jj2qTdwnzv1MCjCALW8m/Qm4axgIn6D8iZeE+gky1v+4eUUNrW/U/hxtP/fjc5z8lIM129A62v+HBBvK+U8y/1N5O/PHTAECg+qK3l5HRv6V3UjyYvgbAWLb7Tg2WxT+in6BQKl7VP3jLxGh73eu/IbJ8ewg+7b/D2aVilU2/vwwZ/4Ca7vC/3ZW13oZB4z+Wu2Rtnt3gPxLI4cQMy/m/lFXdyc9V5L+aHTRnK6HnP/RQxouVAOe/MG4fKPIn1j9RxyWedKLnv/YD3TxxP/w/qbmTubyi9D9WJCPdVTLxvy63wJNSb8g/47e9iS2QAUCstui35w3pv6jgWQLMUNc/sjjoOd2a6L9PgSZypcPvvyFj+r8KWNw/6F4X+9pBvb+maabNZuXVP3odNgRIXNa/OS7HiWRR2j/s0aSTC9HUv3QOTTP2wtg/SIoxflYq6L/cz/MxMbPwv+/SeMiEqIk/hvR/ztID5z9kAw+Tet3tPx3oyilH1tq/nR7GoagAm79N9J2yPcr4v0FJDN7jBty/1bw6Vsv41j9ddb8x6JTaPwaUgbyGiuW/BJpla4q5zT+rFJor1nfiP/uOrwYm3eS/3BMJ9gcql7+TOnzNu03mP1rwziG3/+K/ceJZxWFW+L851y//a5z6v4Inm49AfvI/iPI/6PB77L+xUxOM1L3wv2WhVTRh2uI/iASPLnaR1r8RZnu6RTPtP+Bi9JmveeK/MiqiDBI48j9D5gHDpVr6P/j0JFGWvPi/NU+tgpGfoj+6QZF0vwrcP94BeYqQQOg/OgAfSj9qur+rw89gAWmgv8E066RqAPg/kWsZLdiC+D+zbVlFEiPav2ZoDRK2vvW/aeOv3OuR9b+WMSSgFwfMP5W4qIp74co/Fiq7qC7p4z9QV3ogD3bxP6WMpeW8AeQ/Cr90r7wX6r9N4O1bstLrv1JQZRIyT6u/S9WWVNjz6r9JBfuvXk/oPxaLs1Xq06Q/fYH5r/zU479nV8I1I2XoPyawPNyxGvQ/xPlirG5jAMA2pP6/29Dpvz5T+moT2eS/Rq1xZt0n4b9jUpk62fb5v/rwh4xWzqm/vQ5ctSSF9j/6GNt6OhXov4xpcDX+X/8/4qAtaf5J1b8RTWPsVubqv9poqn8piPM/40vv3WTu0T/a9hjW28z3v2TA1MrOW/S/z5dJEjHS6T+pA6fW4Cr2P1c4QXL6xvG/jg+fFbTzyb+LdMx1RYv8P/aZP1LmjO2/KSA7ZcbV+z/2gSz7CBXgv2RuF8LeJPO/JzgGd2TY+7/LlBrS87cBQF6Cfz3SjNE/TuLnRJzn9r+XSIDX/uTmP5cV7NcTqcm/pYxl1qFdyD+dTR64AJ3+vyIG9tzugte/I+cup52h1b8fQyJPvnP5P83T+JiBLbQ/Xc0EQGzlA0CesRXVt8akv8VSMa9c6+K/wT9jYSxH9T9c8oSi8kvov5poGuE8Hv8/Qg/nm0uU6j+iwnvI2Zr8v7AngsCvNO4/aG7Hq/krsL+P9jeUDyfvP0rcK511N+q/ReRSM1QM1b/1sIxwP+QAwMnQHm3fzMY/fIpynAGB4b9sYR5Bbtrhv3I2lbTzpdc/cnAJ1yGgrj9WR/mcyLD9P8NuCCyv6d2/QTUp5Ik19b+NLQl1iR/qv/DN3E3m0O8/q/eLuzHF4T9gx1UGODDxv1NUiZdTk+w/xq+RB4PK7r/9EWXGaDHxPw==\",\"dtype\":\"float64\",\"shape\":[500]}},\"selected\":{\"id\":\"2183\"},\"selection_policy\":{\"id\":\"2184\"}},\"id\":\"2091\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2065\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2102\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"2083\"}},\"id\":\"2079\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2100\"},\"ticker\":{\"id\":\"2074\"}},\"id\":\"2073\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2080\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2081\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2070\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2082\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2063\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b3\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2094\",\"type\":\"Circle\"},{\"attributes\":{\"items\":[{\"id\":\"2105\"}],\"visible\":false},\"id\":\"2104\",\"type\":\"Legend\"},{\"attributes\":{\"label\":{\"value\":\" \"},\"renderers\":[{\"id\":\"2095\"}]},\"id\":\"2105\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"2091\"},\"glyph\":{\"id\":\"2093\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2094\"},\"selection_glyph\":null,\"view\":{\"id\":\"2096\"}},\"id\":\"2095\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"2069\"},\"ticker\":null},\"id\":\"2072\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2093\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"2091\"}},\"id\":\"2096\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2067\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2183\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"2102\"},\"ticker\":{\"id\":\"2070\"}},\"id\":\"2069\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"2073\"},\"dimension\":1,\"ticker\":null},\"id\":\"2076\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2184\",\"type\":\"UnionRenderers\"}],\"root_ids\":[\"2060\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"ba7c7b69-e2d0-46e1-a267-d3a9d5af2449\",\"root_ids\":[\"2060\"],\"roots\":{\"2060\":\"7f165a19-5789-4bb9-94d7-d28ef9088b94\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2060" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df_norm,\n", " cats=None,\n", " val='x',\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we understand what an ECDF is and how to plot it, let's make a set of ECDFs for our frog data." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"0e757396-2e40-4a20-b935-6cbf60154cee\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2249\"}],\"center\":[{\"id\":\"2252\"},{\"id\":\"2256\"},{\"id\":\"2284\"}],\"left\":[{\"id\":\"2253\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2275\"},{\"id\":\"2290\"},{\"id\":\"2306\"},{\"id\":\"2324\"}],\"title\":{\"id\":\"2277\"},\"toolbar\":{\"id\":\"2264\"},\"x_range\":{\"id\":\"2241\"},\"x_scale\":{\"id\":\"2245\"},\"y_range\":{\"id\":\"2243\"},\"y_scale\":{\"id\":\"2247\"}},\"id\":\"2240\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2304\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2241\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2258\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2262\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2257\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2432\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2289\",\"type\":\"Circle\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2290\"}]},\"id\":\"2301\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2317\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2299\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2261\",\"type\":\"ResetTool\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2306\"}]},\"id\":\"2319\",\"type\":\"LegendItem\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2277\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2322\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2433\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2280\"},\"ticker\":{\"id\":\"2254\"}},\"id\":\"2253\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2316\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2298\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"__ECDF\":{\"__ndarray__\":\"AAAAAAAA8D+amZmZmZnhP5qZmZmZmck/mpmZmZmZ6T8AAAAAAADgP2ZmZmZmZu4/zczMzMzM3D8zMzMzMzPjP83MzMzMzOw/MzMzMzMzwz/NzMzMzMzkP5qZmZmZmbk/AAAAAAAA6D+amZmZmZmpPzMzMzMzM+s/mpmZmZmZ2T8zMzMzMzPTPwAAAAAAANA/ZmZmZmZm1j9mZmZmZmbmPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"adhesive force (mN)\":[-655,-292,-246,-245,-553,-664,-261,-691,-92,-566,-223,-512,-227,-573,-522,-599,-364,-469,-844,-648],\"adhesive force / body weight\":{\"__ndarray__\":\"pHA9Ctej+D8UrkfhehTmP4/C9Shcj+I/j8L1KFyP4j/NzMzMzMz0P/YoXI/C9fg/hetRuB6F4z8UrkfhehT6Pylcj8L1KMw/SOF6FK5H9T+kcD0K16PgPzMzMzMzM/M/9ihcj8L14D+amZmZmZn1P65H4XoUrvM/j8L1KFyP9j+F61G4HoXrP5qZmZmZmfE/16NwPQrX/z9SuB6F61H4Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"pHA9Ctej2L83iUFg5dDSvz81XrpJDNK/w/UoXI/C1b/azvdT46Xbv1pkO99Pjae/5dAi2/l+2r+TGARWDi2yv/yp8dJNYoC/Gy/dJAaBtb+Nl24Sg8DKvylcj8L1KKy/OrTIdr6fmr+F61G4HoXLv2mR7Xw/Nb6/IbByaJHtzL82XrpJDALLv6RwPQrXo9C/yqFFtvP91L9g5dAi2/m+vw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-1881,-1177,-1894,-2301,-2004,-7802,-803,-2860,-678,-4506,-942,-17652,-1101,-3014,-1860,-2757,-1927,-2129,-4925,-4573],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"uB6F61G47j/NzMzMzMzsP65H4XoUruc/UrgehetR6D8UrkfhehTuPwrXo3A9Cuc/zczMzMzM7D8K16NwPQrnPwAAAAAAAPA/CtejcD0K7z8K16NwPQrvP7gehetRuJ4/AAAAAAAA8D9SuB6F61HoPwAAAAAAAPA/AAAAAAAA8D/2KFyPwvXgP3E9CtejcOU/UrgehetR2D9mZmZmZmbmPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[15,24,34,26,16,24,33,67,0,4,8,28,0,46,0,0,89,72,106,43],\"contact pressure (Pa)\":[4633,2441,2517,8893,1959,18073,1627,2600,10645,2367,2972,9279,3647,1288,4213,2369,2302,1737,2665,5149],\"date\":[\"2013_03_19\",\"2013_03_19\",\"2013_03_19\",\"2013_03_19\",\"2013_03_21\",\"2013_03_21\",\"2013_03_21\",\"2013_03_21\",\"2013_03_25\",\"2013_03_25\",\"2013_03_25\",\"2013_03_25\",\"2013_03_28\",\"2013_03_28\",\"2013_04_03\",\"2013_04_03\",\"2013_04_08\",\"2013_04_08\",\"2013_04_08\",\"2013_04_12\"],\"impact force (mN)\":[1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730],\"impact force / body weight\":{\"__ndarray__\":\"UrgehetRDkC4HoXrUbj2P6RwPQrXo+g/16NwPQrXAUBSuB6F61H0P/YoXI/C9QxA16NwPQrX8z+uR+F6FK73P1yPwvUoXAtAZmZmZmZm5j9mZmZmZmb6Pylcj8L1KOQ/UrgehetR/D+PwvUoXI/iPz0K16NwPQZAXI/C9Shc8z9SuB6F61HwP83MzMzMzOw/SOF6FK5H8T+F61G4HoX7Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[18,55,51,59,33,43,28,31,72,42,33,57,39,21,28,29,26,31,15,42],\"index\":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],\"time frog pulls on target (ms)\":[3087,1261,1508,1841,3126,741,2482,998,1652,936,2152,189,1195,1466,1197,1486,1017,974,780,786],\"total contact area (mm2)\":[348,248,130,106,276,85,325,242,136,126,237,29,206,190,281,217,189,221,171,142],\"trial number\":[1,2,3,4,1,2,3,4,1,2,3,4,1,2,1,2,1,2,3,1]},\"selected\":{\"id\":\"2316\"},\"selection_policy\":{\"id\":\"2317\"}},\"id\":\"2286\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#2ba02b\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2305\",\"type\":\"Circle\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2285\"},{\"id\":\"2301\"},{\"id\":\"2319\"},{\"id\":\"2339\"}],\"location\":\"bottom_right\"},\"id\":\"2284\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"2286\"},\"glyph\":{\"id\":\"2288\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2289\"},\"selection_glyph\":null,\"view\":{\"id\":\"2291\"}},\"id\":\"2290\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2271\"}},\"id\":\"2276\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"__ECDF\":{\"__ndarray__\":\"ZmZmZmZm5j+amZmZmZnJP5qZmZmZmak/ZmZmZmZm7j/NzMzMzMzkPwAAAAAAAOA/zczMzMzM3D8zMzMzMzPjPwAAAAAAAPA/MzMzMzMz0z8AAAAAAADQPzMzMzMzM+s/mpmZmZmZ6T+amZmZmZnhP5qZmZmZmdk/mpmZmZmZuT8zMzMzMzPDPwAAAAAAAOg/zczMzMzM7D9mZmZmZmbWPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"adhesive force (mN)\":[-94,-163,-172,-225,-301,-93,-131,-289,-104,-229,-259,-231,-267,-178,-123,-151,-127,-372,-236,-390],\"adhesive force / body weight\":{\"__ndarray__\":\"UrgehetR6D/2KFyPwvX0PxSuR+F6FPY/9ihcj8L1/D9cj8L1KFwDQAAAAAAAAOg/zczMzMzM8D+kcD0K16MCQOF6FK5H4eo/mpmZmZmZ/T+kcD0K16MAQMP1KFyPwv0/H4XrUbgeAUDhehSuR+H2P65H4XoUru8/hetRuB6F8z9SuB6F61HwP+xRuB6F6wdAZmZmZmZm/j8fhetRuB4JQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"/Knx0k1iUL/8qfHSTWKgv9NNYhBYObS/TDeJQWDlwL/Xo3A9CtfDvylcj8L1KLy/PN9PjZduor/jpZvEILCyvylcj8L1KKy/76fGSzeJwb+hRbbz/dTIvxsv3SQGgaW/BoGVQ4tsx7+cxCCwcmihvxgEVg4tsp2/yqFFtvP9tL+F61G4HoXLv+xRuB6F68G/aZHtfD81vr86tMh2vp/Kvw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-967,-1507,-3149,-1818,-2354,-2181,-1005,-2555,-902,-2580,-2855,-2819,-2213,-9364,-5843,-4882,-896,-5136,-1834,-3492],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"j8L1KFyP6j8zMzMzMzPjP65H4XoUrtc/pHA9Ctej6D97FK5H4XqUP7gehetRuOY/AAAAAAAA8D+4HoXrUbjePx+F61G4HuU/ZmZmZmZm7j8zMzMzMzPDP3sUrkfheoQ/zczMzMzM7D+amZmZmZmpP5qZmZmZmak/uB6F61G4nj+F61G4HoXrP+F6FK5H4do/exSuR+F6xD/2KFyPwvXYPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[15,10,23,17,43,34,74,4,55,6,88,23,58,17,29,126,12,1,0,58],\"contact pressure (Pa)\":[6326,3824,5946,6272,4770,12699,4130,5110,6993,5165,5048,7633,5152,28641,25471,12409,2835,8475,5171,4376],\"date\":[\"2013_05_27\",\"2013_05_27\",\"2013_05_27\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_14\",\"2013_06_14\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_26\",\"2013_06_26\",\"2013_06_26\",\"2013_06_26\"],\"impact force (mN)\":[614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488],\"impact force / body weight\":{\"__ndarray__\":\"w/UoXI/CE0CkcD0K16MKQOF6FK5H4QRA9ihcj8L1GECkcD0K16MTQIXrUbgehRFASOF6FK5HEUCkcD0K16MSQPYoXI/C9RlAmpmZmZmZDUCF61G4HoUNQClcj8L1KBRA9ihcj8L1E0CF61G4HoURQDMzMzMzMxFAuB6F61G4CEDXo3A9CtcJQMP1KFyPwhNAZmZmZmZmFUBxPQrXo3APQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[88,143,105,35,29,16,38,31,29,32,30,16,27,30,35,39,36,34,40,34],\"index\":[40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],\"time frog pulls on target (ms)\":[683,245,619,1823,918,1351,1790,1006,883,1218,910,550,2081,376,289,607,2932,680,685,1308],\"total contact area (mm2)\":[97,108,55,124,128,43,130,113,115,89,91,82,120,19,21,31,142,72,129,112],\"trial number\":[1,2,3,1,2,3,1,2,1,2,3,4,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"2336\"},\"selection_policy\":{\"id\":\"2337\"}},\"id\":\"2302\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#d62628\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2323\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2243\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"ID\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__ECDF\":{\"__ndarray__\":\"mpmZmZmZyT8zMzMzMzPDP5qZmZmZmbk/AAAAAAAA4D+amZmZmZnZP5qZmZmZmak/MzMzMzMz4z9mZmZmZmbWP2ZmZmZmZu4/ZmZmZmZm5j8AAAAAAADQPzMzMzMzM9M/AAAAAAAA6D/NzMzMzMzkPwAAAAAAAPA/zczMzMzM3D+amZmZmZnpP83MzMzMzOw/MzMzMzMz6z+amZmZmZnhPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"adhesive force (mN)\":[-456,-193,-236,-225,-217,-161,-139,-264,-342,-231,-209,-292,-339,-371,-331,-302,-216,-163,-367,-218],\"adhesive force / body weight\":{\"__ndarray__\":\"MzMzMzMzC0AK16NwPQr3Pylcj8L1KPw/4XoUrkfh+j/D9Shcj8L5PzMzMzMzM/M/pHA9Ctej8D+F61G4HoX/P2ZmZmZmZgRAhetRuB6F+z/NzMzMzMz4P1yPwvUoXAFAPQrXo3A9BEAUrkfhehQGQMP1KFyPwgNAAAAAAAAAAkDD9Shcj8L5P1yPwvUoXPM/16NwPQrXBUAUrkfhehT6Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"mpmZmZmZqb+q8dJNYhCovxFYObTIdr6/KVyPwvUovL9aZDvfT42Xvzq0yHa+n6q/YxBYObTItr97FK5H4XrEvyGwcmiR7cy/TDeJQWDloL+HFtnO91PDvxgEVg4tss2/lkOLbOf70b+q8dJNYhC4v4PAyqFFtrO/CKwcWmQ7v7+YbhKDwMrBvy2yne+nxsu/8tJNYhBYyb8IrBxaZDu/vw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-3440,-3400,-4647,-1581,-1245,-2866,-2141,-2136,-2497,-3847,-1889,-2018,-1772,-4447,-2190,-2591,-1759,-1257,-2857,-1688],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"KVyPwvUo7D+PwvUoXI/qP0jhehSuR+E/uB6F61G43j9cj8L1KFzvP3sUrkfhepQ/H4XrUbge7T+PwvUoXI/SP4/C9Shcj+o/uB6F61G4nj/hehSuR+HqP65H4XoUru8/AAAAAAAA8D+4HoXrUbi+P7gehetRuOY/7FG4HoXrsT8AAAAAAADwPwrXo3A9Cu8/cT0K16Nw3T+F61G4HoXjPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[0,74,44,108,39,4,77,81,0,4,69,50,12,18,20,30,20,42,108,68],\"contact pressure (Pa)\":[1297,2498,735,3177,2037,397,7713,2205,5259,9705,1793,1369,3116,6184,5386,3446,4928,5498,4776,3617],\"date\":[\"2013_05_27\",\"2013_05_27\",\"2013_05_27\",\"2013_05_30\",\"2013_05_30\",\"2013_05_30\",\"2013_06_03\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_14\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\"],\"impact force (mN)\":[172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468],\"impact force / body weight\":{\"__ndarray__\":\"exSuR+F69D/NzMzMzMzwP+xRuB6F69E/9ihcj8L1CkAfhetRuB4FQMP1KFyPwsU/7FG4HoXrDUA9CtejcD0AQHE9CtejcBVAXI/C9ShcEUCF61G4HoX3P4XrUbgehfc/w/UoXI/CEUC4HoXrUbgOQEjhehSuRxhAAAAAAAAACEAAAAAAAAASQDMzMzMzMxVASOF6FK5HEkDXo3A9CtcLQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[26,20,55,38,31,33,74,26,27,33,23,6,29,31,34,38,39,76,33,36],\"index\":[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],\"time frog pulls on target (ms)\":[462,250,743,844,728,472,959,844,1515,279,1427,2874,4251,626,1254,986,1627,2021,1366,1269],\"total contact area (mm2)\":[133,57,51,142,174,56,65,124,137,60,110,145,191,83,151,117,123,129,128,129],\"trial number\":[2,3,4,1,2,3,1,1,2,3,4,1,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"2432\"},\"selection_policy\":{\"id\":\"2433\"}},\"id\":\"2320\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2337\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2260\",\"type\":\"SaveTool\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2324\"}]},\"id\":\"2339\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2282\"},\"ticker\":{\"id\":\"2250\"}},\"id\":\"2249\",\"type\":\"LinearAxis\"},{\"attributes\":{\"overlay\":{\"id\":\"2263\"}},\"id\":\"2259\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2263\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"2271\"},\"glyph\":{\"id\":\"2273\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2274\"},\"selection_glyph\":null,\"view\":{\"id\":\"2276\"}},\"id\":\"2275\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2282\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"2286\"}},\"id\":\"2291\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2245\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"2320\"}},\"id\":\"2325\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2254\",\"type\":\"BasicTicker\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2257\"},{\"id\":\"2258\"},{\"id\":\"2259\"},{\"id\":\"2260\"},{\"id\":\"2261\"},{\"id\":\"2262\"}]},\"id\":\"2264\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"2249\"},\"ticker\":null},\"id\":\"2252\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"2320\"},\"glyph\":{\"id\":\"2322\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2323\"},\"selection_glyph\":null,\"view\":{\"id\":\"2325\"}},\"id\":\"2324\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2302\"}},\"id\":\"2307\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2250\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"2302\"},\"glyph\":{\"id\":\"2304\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2305\"},\"selection_glyph\":null,\"view\":{\"id\":\"2307\"}},\"id\":\"2306\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2273\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b3\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2274\",\"type\":\"Circle\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2288\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2247\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"2253\"},\"dimension\":1,\"ticker\":null},\"id\":\"2256\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2336\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"__ECDF\":{\"__ndarray__\":\"AAAAAAAA0D9mZmZmZmbuP83MzMzMzOQ/mpmZmZmZ4T+amZmZmZm5P83MzMzMzOw/MzMzMzMzwz+amZmZmZnpPwAAAAAAAPA/AAAAAAAA6D9mZmZmZmbmPwAAAAAAAOA/mpmZmZmZ2T8zMzMzMzPjP83MzMzMzNw/ZmZmZmZm1j+amZmZmZnJPzMzMzMzM+s/MzMzMzMz0z+amZmZmZmpPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"adhesive force (mN)\":[-785,-983,-850,-455,-974,-592,-512,-804,-690,-462,-766,-715,-613,-677,-528,-452,-430,-652,-692,-536],\"adhesive force / body weight\":{\"__ndarray__\":\"UrgehetR9D9xPQrXo3D5P+xRuB6F6/U/rkfhehSu5z8fhetRuB75P7gehetRuO4/j8L1KFyP6j/NzMzMzMz0P+xRuB6F6/E/AAAAAAAA6D/Xo3A9CtfzP2ZmZmZmZvI/rkfhehSu7z9xPQrXo3DxPzMzMzMzM+s/XI/C9Shc5z9mZmZmZmbmP83MzMzMzPA/7FG4HoXr8T/Xo3A9CtfrPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"j8L1KFyP0r9fukkMAivHv39qvHSTGMS/w/UoXI/Cxb/fT42XbhLbv7tJDAIrh8a/PQrXo3A90r89CtejcD3Sv2Q730+Nl86/yqFFtvP91L9SuB6F61HYv99PjZduEtO/+n5qvHST6L9zaJHtfD/dv2Q730+Nl9a//tR46SYx0L9Ei2zn+6nRv6abxCCwctC/fT81XrpJ1L+mm8QgsHLYvw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-2030,-9695,-10239,-1381,-3975,-1737,-1427,-3266,-2568,-1733,-1879,-5064,-1348,-3636,-3453,-1557,-1677,-4425,-1901,-2073],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"PQrXo3A96j/sUbgeheuxP5qZmZmZmak/pHA9Ctej4D+4HoXrUbi+PxSuR+F6FOY/FK5H4XoU5j/sUbgehevRP8P1KFyPwsU/w/UoXI/C1T9xPQrXo3DtP+F6FK5H4co/mpmZmZmZ6T/Xo3A9CtfTP7gehetRuJ4/exSuR+F65D+kcD0K16PgPwrXo3A9Crc/7FG4HoXr0T9mZmZmZmbWPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[70,94,79,158,216,106,110,178,224,176,33,112,92,129,148,105,124,134,260,168],\"contact pressure (Pa)\":[3117,24923,21020,4718,2012,6676,1550,7832,9824,7122,4638,10947,2874,9089,10095,4419,3019,13784,3406,1830],\"date\":[\"2013_02_26\",\"2013_02_26\",\"2013_03_01\",\"2013_03_01\",\"2013_03_01\",\"2013_03_01\",\"2013_03_05\",\"2013_03_05\",\"2013_03_05\",\"2013_03_05\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473],\"impact force / body weight\":{\"__ndarray__\":\"MzMzMzMz/z9SuB6F61EQQI/C9ShcjwZAFK5H4XoUBECamZmZmZnpP3E9CtejcA1AzczMzMzM7D/hehSuR+EIQBSuR+F6FBFAexSuR+F6CEB7FK5H4XoIQAAAAAAAAARA4XoUrkfhAEDXo3A9CtcFQOxRuB6F6wNAj8L1KFyPAEAAAAAAAAD0Pz0K16NwPQpAAAAAAAAAAEBSuB6F61HoPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[46,44,34,41,36,31,43,46,50,41,40,48,29,31,38,31,34,60,34,40],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],\"time frog pulls on target (ms)\":[884,248,211,1025,499,969,835,508,491,839,1069,649,1845,917,750,785,837,486,906,1218],\"total contact area (mm2)\":[387,101,83,330,245,341,359,246,269,266,408,141,455,186,153,290,257,147,364,259],\"trial number\":[3,4,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5]},\"selected\":{\"id\":\"2298\"},\"selection_policy\":{\"id\":\"2299\"}},\"id\":\"2271\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2275\"}]},\"id\":\"2285\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2280\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"2240\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"0e757396-2e40-4a20-b935-6cbf60154cee\",\"root_ids\":[\"2240\"],\"roots\":{\"2240\":\"fb8d6299-81da-4f11-9108-2b3e60230ca5\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2240" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)'\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Each dot in the ECDF is a single data point that we measured. Given the above definition of the ECDF, it is defined for all real $x$. So, formally, the ECDF is a continuous function (with discontinuous derivatives at each data point). So, it should be plotted like a staircase according to the formal definition. We can plot it that way using the `style` keyword argument." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"97ac1930-4f64-4bbc-bcf4-3d3be614a53f\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2534\"}],\"center\":[{\"id\":\"2537\"},{\"id\":\"2541\"},{\"id\":\"2568\"}],\"left\":[{\"id\":\"2538\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2559\"},{\"id\":\"2573\"},{\"id\":\"2587\"},{\"id\":\"2603\"},{\"id\":\"2622\"},{\"id\":\"2642\"},{\"id\":\"2664\"},{\"id\":\"2689\"},{\"id\":\"2715\"},{\"id\":\"2743\"},{\"id\":\"2774\"},{\"id\":\"2806\"}],\"title\":{\"id\":\"2561\"},\"toolbar\":{\"id\":\"2549\"},\"x_range\":{\"id\":\"2526\"},\"x_scale\":{\"id\":\"2530\"},\"y_range\":{\"id\":\"2528\"},\"y_scale\":{\"id\":\"2532\"}},\"id\":\"2525\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2597\"},\"selection_policy\":{\"id\":\"2598\"}},\"id\":\"2570\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2559\"},{\"id\":\"2573\"},{\"id\":\"2587\"}]},\"id\":\"2569\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"2570\"}},\"id\":\"2574\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2960\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2597\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2571\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2572\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2767\"},\"selection_policy\":{\"id\":\"2768\"}},\"id\":\"2712\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2543\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2548\"}},\"id\":\"2544\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2709\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2528\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2542\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"2686\"}},\"id\":\"2690\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2545\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2600\"},\"glyph\":{\"id\":\"2601\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2602\"},\"selection_glyph\":null,\"view\":{\"id\":\"2604\"}},\"id\":\"2603\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2600\"}},\"id\":\"2604\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2546\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2835\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2961\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2615\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2710\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2569\"},{\"id\":\"2618\"},{\"id\":\"2685\"},{\"id\":\"2770\"}],\"location\":\"bottom_right\"},\"id\":\"2568\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"2547\",\"type\":\"HelpTool\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2603\"},{\"id\":\"2622\"},{\"id\":\"2642\"}]},\"id\":\"2618\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2616\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2682\"},\"selection_policy\":{\"id\":\"2683\"}},\"id\":\"2639\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2767\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2658\"},\"selection_policy\":{\"id\":\"2659\"}},\"id\":\"2619\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2713\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2768\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2737\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2714\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2582\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2598\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2620\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2712\"},\"glyph\":{\"id\":\"2713\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2714\"},\"selection_glyph\":null,\"view\":{\"id\":\"2716\"}},\"id\":\"2715\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2584\"},\"glyph\":{\"id\":\"2585\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2586\"},\"selection_glyph\":null,\"view\":{\"id\":\"2588\"}},\"id\":\"2587\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2712\"}},\"id\":\"2716\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2636\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2564\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"2584\"}},\"id\":\"2588\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2738\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2586\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2619\"},\"glyph\":{\"id\":\"2620\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2621\"},\"selection_glyph\":null,\"view\":{\"id\":\"2623\"}},\"id\":\"2622\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2566\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2530\",\"type\":\"LinearScale\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2585\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"2619\"}},\"id\":\"2623\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2740\"},\"glyph\":{\"id\":\"2741\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2742\"},\"selection_glyph\":null,\"view\":{\"id\":\"2744\"}},\"id\":\"2743\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2662\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2637\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2526\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"2740\"}},\"id\":\"2744\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2658\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2548\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"2534\"},\"ticker\":null},\"id\":\"2537\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2535\",\"type\":\"BasicTicker\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2640\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QAAAAAAAgEJAAAAAAACAQkAAAAAAAMBhQAAAAAAAwGFAAAAAAACAZUAAAAAAAIBlQAAAAAAAwGhAAAAAAADAaEAAAAAAAMBoQAAAAAAAwGhAAAAAAAAQcUAAAAAAABBxQAAAAAAAMHZAAAAAAAAwdkAAAAAAACB5QAAAAAAAIHlAAAAAAABQfEAAAAAAAFB8QAAAAAAAQH1AAAAAAABAfUAAAAAAAGB/QAAAAAAAYH9AAAAAAAAggEAAAAAAACCAQAAAAAAAMIJAAAAAAAAwgkAAAAAAAKiCQAAAAAAAqIJAAAAAAADogkAAAAAAAOiCQAAAAAAAMINAAAAAAAAwg0AAAAAAADiGQAAAAAAAOIZAAAAAAACAhkAAAAAAAICGQAAAAAAAeIlAAAAAAAB4iUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2800\"},\"selection_policy\":{\"id\":\"2801\"}},\"id\":\"2740\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2742\",\"type\":\"Line\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2542\"},{\"id\":\"2543\"},{\"id\":\"2544\"},{\"id\":\"2545\"},{\"id\":\"2546\"},{\"id\":\"2547\"}]},\"id\":\"2549\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"2538\"},\"dimension\":1,\"ticker\":null},\"id\":\"2541\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"2661\"}},\"id\":\"2665\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2570\"},\"glyph\":{\"id\":\"2571\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2572\"},\"selection_glyph\":null,\"view\":{\"id\":\"2574\"}},\"id\":\"2573\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2641\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2772\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2960\"},\"selection_policy\":{\"id\":\"2961\"}},\"id\":\"2803\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2639\"},\"glyph\":{\"id\":\"2640\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2641\"},\"selection_glyph\":null,\"view\":{\"id\":\"2643\"}},\"id\":\"2642\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2773\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2601\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2639\"}},\"id\":\"2643\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2834\"},\"selection_policy\":{\"id\":\"2835\"}},\"id\":\"2771\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2743\"},{\"id\":\"2774\"},{\"id\":\"2806\"}]},\"id\":\"2770\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQAAAAAAA0HBAAAAAAADQcEAAAAAAAJByQAAAAAAAkHJAAAAAAABwdEAAAAAAAHB0QAAAAAAA8HdAAAAAAADwd0AAAAAAADB7QAAAAAAAMHtAAAAAAACQfEAAAAAAAJB8QAAAAAAAGIBAAAAAAAAYgEAAAAAAAIiAQAAAAAAAiIBAAAAAAADogEAAAAAAAOiAQAAAAAAA6IJAAAAAAADogkAAAAAAAKCDQAAAAAAAoINAAAAAAAD4hUAAAAAAAPiFQAAAAAAA0IZAAAAAAADQhkAAAAAAAHiHQAAAAAAAeIdAAAAAAACQjUAAAAAAAJCNQAAAAAAAeJJAAAAAAAB4kkAAAAAAALSWQAAAAAAAtJZAAAAAAAAMmEAAAAAAAAyYQAAAAAAAMJlAAAAAAAAwmUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2636\"},\"selection_policy\":{\"id\":\"2637\"}},\"id\":\"2600\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2834\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2566\"},\"ticker\":{\"id\":\"2535\"}},\"id\":\"2534\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2741\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QAAAAAAAEHhAAAAAAAAQeEAAAAAAABB5QAAAAAAAEHlAAAAAAADgeUAAAAAAAOB5QAAAAAAAoHxAAAAAAACgfEAAAAAAALB8QAAAAAAAsHxAAAAAAACAfkAAAAAAAIB+QAAAAAAAuIBAAAAAAAC4gEAAAAAAANCAQAAAAAAA0IBAAAAAAAAAgUAAAAAAAACBQAAAAAAAAIFAAAAAAAAAgUAAAAAAABiCQAAAAAAAGIJAAAAAAAAYg0AAAAAAABiDQAAAAAAAMINAAAAAAAAwg0AAAAAAADCDQAAAAAAAMINAAAAAAABog0AAAAAAAGiDQAAAAAAAkINAAAAAAACQg0AAAAAAAMiEQAAAAAAAyIRAAAAAAABAiEAAAAAAAECIQAAAAAAAMIlAAAAAAAAwiUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2709\"},\"selection_policy\":{\"id\":\"2710\"}},\"id\":\"2661\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2659\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2771\"},\"glyph\":{\"id\":\"2772\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2773\"},\"selection_glyph\":null,\"view\":{\"id\":\"2775\"}},\"id\":\"2774\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2556\"}},\"id\":\"2560\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"2771\"}},\"id\":\"2775\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2532\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QAAAAAAA0H5AAAAAAADQfkAAAAAAAGCBQAAAAAAAYIFAAAAAAAA4iEAAAAAAADiIQAAAAAAA1JJAAAAAAADUkkAAAAAAAGCTQAAAAAAAYJNAAAAAAAAIlEAAAAAAAAiUQAAAAAAAbJRAAAAAAABslEAAAAAAAByYQAAAAAAAHJhAAAAAAAAkmEAAAAAAACSYQAAAAAAAUJhAAAAAAABQmEAAAAAAAHCaQAAAAAAAcJpAAAAAAABEm0AAAAAAAESbQAAAAAAAjJ1AAAAAAACMnUAAAAAAAKSdQAAAAAAApJ1AAAAAAAAgnkAAAAAAACCeQAAAAAAAwJ9AAAAAAADAn0AAAAAAAMihQAAAAAAAyKFAAAAAAAC+o0AAAAAAAL6jQAAAAAAAoqRAAAAAAACipEA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2581\"},\"selection_policy\":{\"id\":\"2582\"}},\"id\":\"2556\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2800\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2561\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2682\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2661\"},\"glyph\":{\"id\":\"2662\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2663\"},\"selection_glyph\":null,\"view\":{\"id\":\"2665\"}},\"id\":\"2664\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2556\"},\"glyph\":{\"id\":\"2557\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2558\"},\"selection_glyph\":null,\"view\":{\"id\":\"2560\"}},\"id\":\"2559\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2801\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2804\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2581\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2539\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2663\",\"type\":\"Line\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2564\"},\"ticker\":{\"id\":\"2539\"}},\"id\":\"2538\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2558\",\"type\":\"Line\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2805\",\"type\":\"Ray\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2664\"},{\"id\":\"2689\"},{\"id\":\"2715\"}]},\"id\":\"2685\",\"type\":\"LegendItem\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2557\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2683\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2803\"},\"glyph\":{\"id\":\"2804\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2805\"},\"selection_glyph\":null,\"view\":{\"id\":\"2807\"}},\"id\":\"2806\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2615\"},\"selection_policy\":{\"id\":\"2616\"}},\"id\":\"2584\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2737\"},\"selection_policy\":{\"id\":\"2738\"}},\"id\":\"2686\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2803\"}},\"id\":\"2807\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2688\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2621\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2687\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2686\"},\"glyph\":{\"id\":\"2687\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2688\"},\"selection_glyph\":null,\"view\":{\"id\":\"2690\"}},\"id\":\"2689\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2602\",\"type\":\"Line\"}],\"root_ids\":[\"2525\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"97ac1930-4f64-4bbc-bcf4-3d3be614a53f\",\"root_ids\":[\"2525\"],\"roots\":{\"2525\":\"858f1fc3-accd-4c92-b269-f9dbc8ef2c63\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2525" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " style='staircase',\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is still plotting all of your data. The concave corners of the staircase correspond to the measured data. This can be seen by overlaying the \"dot\" version of the ECDFs." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"f52055da-c73a-4b65-ad27-4954c2d99275\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2534\"}],\"center\":[{\"id\":\"2537\"},{\"id\":\"2541\"},{\"id\":\"2568\"}],\"left\":[{\"id\":\"2538\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2559\"},{\"id\":\"2573\"},{\"id\":\"2587\"},{\"id\":\"2603\"},{\"id\":\"2622\"},{\"id\":\"2642\"},{\"id\":\"2664\"},{\"id\":\"2689\"},{\"id\":\"2715\"},{\"id\":\"2743\"},{\"id\":\"2774\"},{\"id\":\"2806\"},{\"id\":\"3153\"},{\"id\":\"3446\"},{\"id\":\"3745\"},{\"id\":\"4050\"}],\"title\":{\"id\":\"2561\"},\"toolbar\":{\"id\":\"2549\"},\"x_range\":{\"id\":\"2526\"},\"x_scale\":{\"id\":\"2530\"},\"y_range\":{\"id\":\"2528\"},\"y_scale\":{\"id\":\"2532\"}},\"id\":\"2525\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2597\"},\"selection_policy\":{\"id\":\"2598\"}},\"id\":\"2570\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3913\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3912\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#2ba02b\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3744\",\"type\":\"Circle\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2559\"},{\"id\":\"2573\"},{\"id\":\"2587\"},{\"id\":\"3153\"}]},\"id\":\"2569\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"2570\"}},\"id\":\"2574\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3741\"},\"glyph\":{\"id\":\"3743\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3744\"},\"selection_glyph\":null,\"view\":{\"id\":\"3746\"}},\"id\":\"3745\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"3741\"}},\"id\":\"3746\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2960\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2597\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2571\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2572\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2767\"},\"selection_policy\":{\"id\":\"2768\"}},\"id\":\"2712\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2543\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"__ECDF\":{\"__ndarray__\":\"AAAAAAAA8D+amZmZmZnhP5qZmZmZmck/mpmZmZmZ6T8AAAAAAADgP2ZmZmZmZu4/zczMzMzM3D8zMzMzMzPjP83MzMzMzOw/MzMzMzMzwz/NzMzMzMzkP5qZmZmZmbk/AAAAAAAA6D+amZmZmZmpPzMzMzMzM+s/mpmZmZmZ2T8zMzMzMzPTPwAAAAAAANA/ZmZmZmZm1j9mZmZmZmbmPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"adhesive force (mN)\":[-655,-292,-246,-245,-553,-664,-261,-691,-92,-566,-223,-512,-227,-573,-522,-599,-364,-469,-844,-648],\"adhesive force / body weight\":{\"__ndarray__\":\"pHA9Ctej+D8UrkfhehTmP4/C9Shcj+I/j8L1KFyP4j/NzMzMzMz0P/YoXI/C9fg/hetRuB6F4z8UrkfhehT6Pylcj8L1KMw/SOF6FK5H9T+kcD0K16PgPzMzMzMzM/M/9ihcj8L14D+amZmZmZn1P65H4XoUrvM/j8L1KFyP9j+F61G4HoXrP5qZmZmZmfE/16NwPQrX/z9SuB6F61H4Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"pHA9Ctej2L83iUFg5dDSvz81XrpJDNK/w/UoXI/C1b/azvdT46Xbv1pkO99Pjae/5dAi2/l+2r+TGARWDi2yv/yp8dJNYoC/Gy/dJAaBtb+Nl24Sg8DKvylcj8L1KKy/OrTIdr6fmr+F61G4HoXLv2mR7Xw/Nb6/IbByaJHtzL82XrpJDALLv6RwPQrXo9C/yqFFtvP91L9g5dAi2/m+vw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-1881,-1177,-1894,-2301,-2004,-7802,-803,-2860,-678,-4506,-942,-17652,-1101,-3014,-1860,-2757,-1927,-2129,-4925,-4573],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"uB6F61G47j/NzMzMzMzsP65H4XoUruc/UrgehetR6D8UrkfhehTuPwrXo3A9Cuc/zczMzMzM7D8K16NwPQrnPwAAAAAAAPA/CtejcD0K7z8K16NwPQrvP7gehetRuJ4/AAAAAAAA8D9SuB6F61HoPwAAAAAAAPA/AAAAAAAA8D/2KFyPwvXgP3E9CtejcOU/UrgehetR2D9mZmZmZmbmPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[15,24,34,26,16,24,33,67,0,4,8,28,0,46,0,0,89,72,106,43],\"contact pressure (Pa)\":[4633,2441,2517,8893,1959,18073,1627,2600,10645,2367,2972,9279,3647,1288,4213,2369,2302,1737,2665,5149],\"date\":[\"2013_03_19\",\"2013_03_19\",\"2013_03_19\",\"2013_03_19\",\"2013_03_21\",\"2013_03_21\",\"2013_03_21\",\"2013_03_21\",\"2013_03_25\",\"2013_03_25\",\"2013_03_25\",\"2013_03_25\",\"2013_03_28\",\"2013_03_28\",\"2013_04_03\",\"2013_04_03\",\"2013_04_08\",\"2013_04_08\",\"2013_04_08\",\"2013_04_12\"],\"impact force (mN)\":[1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730],\"impact force / body weight\":{\"__ndarray__\":\"UrgehetRDkC4HoXrUbj2P6RwPQrXo+g/16NwPQrXAUBSuB6F61H0P/YoXI/C9QxA16NwPQrX8z+uR+F6FK73P1yPwvUoXAtAZmZmZmZm5j9mZmZmZmb6Pylcj8L1KOQ/UrgehetR/D+PwvUoXI/iPz0K16NwPQZAXI/C9Shc8z9SuB6F61HwP83MzMzMzOw/SOF6FK5H8T+F61G4HoX7Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[18,55,51,59,33,43,28,31,72,42,33,57,39,21,28,29,26,31,15,42],\"index\":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],\"time frog pulls on target (ms)\":[3087,1261,1508,1841,3126,741,2482,998,1652,936,2152,189,1195,1466,1197,1486,1017,974,780,786],\"total contact area (mm2)\":[348,248,130,106,276,85,325,242,136,126,237,29,206,190,281,217,189,221,171,142],\"trial number\":[1,2,3,4,1,2,3,4,1,2,3,4,1,2,1,2,1,2,3,1]},\"selected\":{\"id\":\"3609\"},\"selection_policy\":{\"id\":\"3610\"}},\"id\":\"3442\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"2548\"}},\"id\":\"2544\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2709\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2528\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2542\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"2686\"}},\"id\":\"2690\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2545\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2600\"},\"glyph\":{\"id\":\"2601\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2602\"},\"selection_glyph\":null,\"view\":{\"id\":\"2604\"}},\"id\":\"2603\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2600\"}},\"id\":\"2604\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2546\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2835\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2961\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2615\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2710\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2569\"},{\"id\":\"2618\"},{\"id\":\"2685\"},{\"id\":\"2770\"}],\"location\":\"bottom_right\"},\"id\":\"2568\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"2547\",\"type\":\"HelpTool\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2603\"},{\"id\":\"2622\"},{\"id\":\"2642\"},{\"id\":\"3446\"}]},\"id\":\"2618\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"4222\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2616\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2682\"},\"selection_policy\":{\"id\":\"2683\"}},\"id\":\"2639\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2767\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2658\"},\"selection_policy\":{\"id\":\"2659\"}},\"id\":\"2619\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2713\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2768\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"__ECDF\":{\"__ndarray__\":\"AAAAAAAA0D9mZmZmZmbuP83MzMzMzOQ/mpmZmZmZ4T+amZmZmZm5P83MzMzMzOw/MzMzMzMzwz+amZmZmZnpPwAAAAAAAPA/AAAAAAAA6D9mZmZmZmbmPwAAAAAAAOA/mpmZmZmZ2T8zMzMzMzPjP83MzMzMzNw/ZmZmZmZm1j+amZmZmZnJPzMzMzMzM+s/MzMzMzMz0z+amZmZmZmpPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"adhesive force (mN)\":[-785,-983,-850,-455,-974,-592,-512,-804,-690,-462,-766,-715,-613,-677,-528,-452,-430,-652,-692,-536],\"adhesive force / body weight\":{\"__ndarray__\":\"UrgehetR9D9xPQrXo3D5P+xRuB6F6/U/rkfhehSu5z8fhetRuB75P7gehetRuO4/j8L1KFyP6j/NzMzMzMz0P+xRuB6F6/E/AAAAAAAA6D/Xo3A9CtfzP2ZmZmZmZvI/rkfhehSu7z9xPQrXo3DxPzMzMzMzM+s/XI/C9Shc5z9mZmZmZmbmP83MzMzMzPA/7FG4HoXr8T/Xo3A9CtfrPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"j8L1KFyP0r9fukkMAivHv39qvHSTGMS/w/UoXI/Cxb/fT42XbhLbv7tJDAIrh8a/PQrXo3A90r89CtejcD3Sv2Q730+Nl86/yqFFtvP91L9SuB6F61HYv99PjZduEtO/+n5qvHST6L9zaJHtfD/dv2Q730+Nl9a//tR46SYx0L9Ei2zn+6nRv6abxCCwctC/fT81XrpJ1L+mm8QgsHLYvw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-2030,-9695,-10239,-1381,-3975,-1737,-1427,-3266,-2568,-1733,-1879,-5064,-1348,-3636,-3453,-1557,-1677,-4425,-1901,-2073],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"PQrXo3A96j/sUbgeheuxP5qZmZmZmak/pHA9Ctej4D+4HoXrUbi+PxSuR+F6FOY/FK5H4XoU5j/sUbgehevRP8P1KFyPwsU/w/UoXI/C1T9xPQrXo3DtP+F6FK5H4co/mpmZmZmZ6T/Xo3A9CtfTP7gehetRuJ4/exSuR+F65D+kcD0K16PgPwrXo3A9Crc/7FG4HoXr0T9mZmZmZmbWPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[70,94,79,158,216,106,110,178,224,176,33,112,92,129,148,105,124,134,260,168],\"contact pressure (Pa)\":[3117,24923,21020,4718,2012,6676,1550,7832,9824,7122,4638,10947,2874,9089,10095,4419,3019,13784,3406,1830],\"date\":[\"2013_02_26\",\"2013_02_26\",\"2013_03_01\",\"2013_03_01\",\"2013_03_01\",\"2013_03_01\",\"2013_03_05\",\"2013_03_05\",\"2013_03_05\",\"2013_03_05\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_12\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\",\"2013_03_15\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473],\"impact force / body weight\":{\"__ndarray__\":\"MzMzMzMz/z9SuB6F61EQQI/C9ShcjwZAFK5H4XoUBECamZmZmZnpP3E9CtejcA1AzczMzMzM7D/hehSuR+EIQBSuR+F6FBFAexSuR+F6CEB7FK5H4XoIQAAAAAAAAARA4XoUrkfhAEDXo3A9CtcFQOxRuB6F6wNAj8L1KFyPAEAAAAAAAAD0Pz0K16NwPQpAAAAAAAAAAEBSuB6F61HoPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[46,44,34,41,36,31,43,46,50,41,40,48,29,31,38,31,34,60,34,40],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],\"time frog pulls on target (ms)\":[884,248,211,1025,499,969,835,508,491,839,1069,649,1845,917,750,785,837,486,906,1218],\"total contact area (mm2)\":[387,101,83,330,245,341,359,246,269,266,408,141,455,186,153,290,257,147,364,259],\"trial number\":[3,4,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5]},\"selected\":{\"id\":\"3312\"},\"selection_policy\":{\"id\":\"3313\"}},\"id\":\"3149\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2737\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2714\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2582\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2598\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"4046\"},\"glyph\":{\"id\":\"4048\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4049\"},\"selection_glyph\":null,\"view\":{\"id\":\"4051\"}},\"id\":\"4050\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2620\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2712\"},\"glyph\":{\"id\":\"2713\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2714\"},\"selection_glyph\":null,\"view\":{\"id\":\"2716\"}},\"id\":\"2715\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2584\"},\"glyph\":{\"id\":\"2585\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2586\"},\"selection_glyph\":null,\"view\":{\"id\":\"2588\"}},\"id\":\"2587\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2712\"}},\"id\":\"2716\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2636\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3313\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2564\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"2584\"}},\"id\":\"2588\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2738\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2586\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"4046\"}},\"id\":\"4051\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2619\"},\"glyph\":{\"id\":\"2620\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2621\"},\"selection_glyph\":null,\"view\":{\"id\":\"2623\"}},\"id\":\"2622\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2566\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2530\",\"type\":\"LinearScale\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2585\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"2619\"}},\"id\":\"2623\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4221\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2740\"},\"glyph\":{\"id\":\"2741\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2742\"},\"selection_glyph\":null,\"view\":{\"id\":\"2744\"}},\"id\":\"2743\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2662\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2637\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2526\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"2740\"}},\"id\":\"2744\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3445\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2658\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2548\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"2534\"},\"ticker\":null},\"id\":\"2537\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2535\",\"type\":\"BasicTicker\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2640\",\"type\":\"Ray\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b3\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3152\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QAAAAAAAgEJAAAAAAACAQkAAAAAAAMBhQAAAAAAAwGFAAAAAAACAZUAAAAAAAIBlQAAAAAAAwGhAAAAAAADAaEAAAAAAAMBoQAAAAAAAwGhAAAAAAAAQcUAAAAAAABBxQAAAAAAAMHZAAAAAAAAwdkAAAAAAACB5QAAAAAAAIHlAAAAAAABQfEAAAAAAAFB8QAAAAAAAQH1AAAAAAABAfUAAAAAAAGB/QAAAAAAAYH9AAAAAAAAggEAAAAAAACCAQAAAAAAAMIJAAAAAAAAwgkAAAAAAAKiCQAAAAAAAqIJAAAAAAADogkAAAAAAAOiCQAAAAAAAMINAAAAAAAAwg0AAAAAAADiGQAAAAAAAOIZAAAAAAACAhkAAAAAAAICGQAAAAAAAeIlAAAAAAAB4iUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2800\"},\"selection_policy\":{\"id\":\"2801\"}},\"id\":\"2740\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2742\",\"type\":\"Line\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2542\"},{\"id\":\"2543\"},{\"id\":\"2544\"},{\"id\":\"2545\"},{\"id\":\"2546\"},{\"id\":\"2547\"}]},\"id\":\"2549\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"2538\"},\"dimension\":1,\"ticker\":null},\"id\":\"2541\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"2661\"}},\"id\":\"2665\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2570\"},\"glyph\":{\"id\":\"2571\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2572\"},\"selection_glyph\":null,\"view\":{\"id\":\"2574\"}},\"id\":\"2573\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2641\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2772\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2960\"},\"selection_policy\":{\"id\":\"2961\"}},\"id\":\"2803\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"ID\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"__ECDF\":{\"__ndarray__\":\"ZmZmZmZm5j+amZmZmZnJP5qZmZmZmak/ZmZmZmZm7j/NzMzMzMzkPwAAAAAAAOA/zczMzMzM3D8zMzMzMzPjPwAAAAAAAPA/MzMzMzMz0z8AAAAAAADQPzMzMzMzM+s/mpmZmZmZ6T+amZmZmZnhP5qZmZmZmdk/mpmZmZmZuT8zMzMzMzPDPwAAAAAAAOg/zczMzMzM7D9mZmZmZmbWPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"adhesive force (mN)\":[-94,-163,-172,-225,-301,-93,-131,-289,-104,-229,-259,-231,-267,-178,-123,-151,-127,-372,-236,-390],\"adhesive force / body weight\":{\"__ndarray__\":\"UrgehetR6D/2KFyPwvX0PxSuR+F6FPY/9ihcj8L1/D9cj8L1KFwDQAAAAAAAAOg/zczMzMzM8D+kcD0K16MCQOF6FK5H4eo/mpmZmZmZ/T+kcD0K16MAQMP1KFyPwv0/H4XrUbgeAUDhehSuR+H2P65H4XoUru8/hetRuB6F8z9SuB6F61HwP+xRuB6F6wdAZmZmZmZm/j8fhetRuB4JQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"/Knx0k1iUL/8qfHSTWKgv9NNYhBYObS/TDeJQWDlwL/Xo3A9CtfDvylcj8L1KLy/PN9PjZduor/jpZvEILCyvylcj8L1KKy/76fGSzeJwb+hRbbz/dTIvxsv3SQGgaW/BoGVQ4tsx7+cxCCwcmihvxgEVg4tsp2/yqFFtvP9tL+F61G4HoXLv+xRuB6F68G/aZHtfD81vr86tMh2vp/Kvw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-967,-1507,-3149,-1818,-2354,-2181,-1005,-2555,-902,-2580,-2855,-2819,-2213,-9364,-5843,-4882,-896,-5136,-1834,-3492],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"j8L1KFyP6j8zMzMzMzPjP65H4XoUrtc/pHA9Ctej6D97FK5H4XqUP7gehetRuOY/AAAAAAAA8D+4HoXrUbjePx+F61G4HuU/ZmZmZmZm7j8zMzMzMzPDP3sUrkfheoQ/zczMzMzM7D+amZmZmZmpP5qZmZmZmak/uB6F61G4nj+F61G4HoXrP+F6FK5H4do/exSuR+F6xD/2KFyPwvXYPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[15,10,23,17,43,34,74,4,55,6,88,23,58,17,29,126,12,1,0,58],\"contact pressure (Pa)\":[6326,3824,5946,6272,4770,12699,4130,5110,6993,5165,5048,7633,5152,28641,25471,12409,2835,8475,5171,4376],\"date\":[\"2013_05_27\",\"2013_05_27\",\"2013_05_27\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_14\",\"2013_06_14\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_26\",\"2013_06_26\",\"2013_06_26\",\"2013_06_26\"],\"impact force (mN)\":[614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488],\"impact force / body weight\":{\"__ndarray__\":\"w/UoXI/CE0CkcD0K16MKQOF6FK5H4QRA9ihcj8L1GECkcD0K16MTQIXrUbgehRFASOF6FK5HEUCkcD0K16MSQPYoXI/C9RlAmpmZmZmZDUCF61G4HoUNQClcj8L1KBRA9ihcj8L1E0CF61G4HoURQDMzMzMzMxFAuB6F61G4CEDXo3A9CtcJQMP1KFyPwhNAZmZmZmZmFUBxPQrXo3APQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[88,143,105,35,29,16,38,31,29,32,30,16,27,30,35,39,36,34,40,34],\"index\":[40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],\"time frog pulls on target (ms)\":[683,245,619,1823,918,1351,1790,1006,883,1218,910,550,2081,376,289,607,2932,680,685,1308],\"total contact area (mm2)\":[97,108,55,124,128,43,130,113,115,89,91,82,120,19,21,31,142,72,129,112],\"trial number\":[1,2,3,1,2,3,1,2,1,2,3,4,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"3912\"},\"selection_policy\":{\"id\":\"3913\"}},\"id\":\"3741\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2639\"},\"glyph\":{\"id\":\"2640\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2641\"},\"selection_glyph\":null,\"view\":{\"id\":\"2643\"}},\"id\":\"2642\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2773\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2601\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2639\"}},\"id\":\"2643\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2834\"},\"selection_policy\":{\"id\":\"2835\"}},\"id\":\"2771\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2743\"},{\"id\":\"2774\"},{\"id\":\"2806\"},{\"id\":\"4050\"}]},\"id\":\"2770\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQAAAAAAA0HBAAAAAAADQcEAAAAAAAJByQAAAAAAAkHJAAAAAAABwdEAAAAAAAHB0QAAAAAAA8HdAAAAAAADwd0AAAAAAADB7QAAAAAAAMHtAAAAAAACQfEAAAAAAAJB8QAAAAAAAGIBAAAAAAAAYgEAAAAAAAIiAQAAAAAAAiIBAAAAAAADogEAAAAAAAOiAQAAAAAAA6IJAAAAAAADogkAAAAAAAKCDQAAAAAAAoINAAAAAAAD4hUAAAAAAAPiFQAAAAAAA0IZAAAAAAADQhkAAAAAAAHiHQAAAAAAAeIdAAAAAAACQjUAAAAAAAJCNQAAAAAAAeJJAAAAAAAB4kkAAAAAAALSWQAAAAAAAtJZAAAAAAAAMmEAAAAAAAAyYQAAAAAAAMJlAAAAAAAAwmUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2636\"},\"selection_policy\":{\"id\":\"2637\"}},\"id\":\"2600\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"ID\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__ECDF\":{\"__ndarray__\":\"mpmZmZmZyT8zMzMzMzPDP5qZmZmZmbk/AAAAAAAA4D+amZmZmZnZP5qZmZmZmak/MzMzMzMz4z9mZmZmZmbWP2ZmZmZmZu4/ZmZmZmZm5j8AAAAAAADQPzMzMzMzM9M/AAAAAAAA6D/NzMzMzMzkPwAAAAAAAPA/zczMzMzM3D+amZmZmZnpP83MzMzMzOw/MzMzMzMz6z+amZmZmZnhPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"adhesive force (mN)\":[-456,-193,-236,-225,-217,-161,-139,-264,-342,-231,-209,-292,-339,-371,-331,-302,-216,-163,-367,-218],\"adhesive force / body weight\":{\"__ndarray__\":\"MzMzMzMzC0AK16NwPQr3Pylcj8L1KPw/4XoUrkfh+j/D9Shcj8L5PzMzMzMzM/M/pHA9Ctej8D+F61G4HoX/P2ZmZmZmZgRAhetRuB6F+z/NzMzMzMz4P1yPwvUoXAFAPQrXo3A9BEAUrkfhehQGQMP1KFyPwgNAAAAAAAAAAkDD9Shcj8L5P1yPwvUoXPM/16NwPQrXBUAUrkfhehT6Pw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"mpmZmZmZqb+q8dJNYhCovxFYObTIdr6/KVyPwvUovL9aZDvfT42Xvzq0yHa+n6q/YxBYObTItr97FK5H4XrEvyGwcmiR7cy/TDeJQWDloL+HFtnO91PDvxgEVg4tss2/lkOLbOf70b+q8dJNYhC4v4PAyqFFtrO/CKwcWmQ7v7+YbhKDwMrBvy2yne+nxsu/8tJNYhBYyb8IrBxaZDu/vw==\",\"dtype\":\"float64\",\"shape\":[20]},\"adhesive strength (Pa)\":[-3440,-3400,-4647,-1581,-1245,-2866,-2141,-2136,-2497,-3847,-1889,-2018,-1772,-4447,-2190,-2591,-1759,-1257,-2857,-1688],\"contact area with mucus / contact area without mucus\":{\"__ndarray__\":\"KVyPwvUo7D+PwvUoXI/qP0jhehSuR+E/uB6F61G43j9cj8L1KFzvP3sUrkfhepQ/H4XrUbge7T+PwvUoXI/SP4/C9Shcj+o/uB6F61G4nj/hehSuR+HqP65H4XoUru8/AAAAAAAA8D+4HoXrUbi+P7gehetRuOY/7FG4HoXrsT8AAAAAAADwPwrXo3A9Cu8/cT0K16Nw3T+F61G4HoXjPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"contact area without mucus (mm2)\":[0,74,44,108,39,4,77,81,0,4,69,50,12,18,20,30,20,42,108,68],\"contact pressure (Pa)\":[1297,2498,735,3177,2037,397,7713,2205,5259,9705,1793,1369,3116,6184,5386,3446,4928,5498,4776,3617],\"date\":[\"2013_05_27\",\"2013_05_27\",\"2013_05_27\",\"2013_05_30\",\"2013_05_30\",\"2013_05_30\",\"2013_06_03\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_11\",\"2013_06_14\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_18\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\",\"2013_06_21\"],\"impact force (mN)\":[172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468],\"impact force / body weight\":{\"__ndarray__\":\"exSuR+F69D/NzMzMzMzwP+xRuB6F69E/9ihcj8L1CkAfhetRuB4FQMP1KFyPwsU/7FG4HoXrDUA9CtejcD0AQHE9CtejcBVAXI/C9ShcEUCF61G4HoX3P4XrUbgehfc/w/UoXI/CEUC4HoXrUbgOQEjhehSuRxhAAAAAAAAACEAAAAAAAAASQDMzMzMzMxVASOF6FK5HEkDXo3A9CtcLQA==\",\"dtype\":\"float64\",\"shape\":[20]},\"impact time (ms)\":[26,20,55,38,31,33,74,26,27,33,23,6,29,31,34,38,39,76,33,36],\"index\":[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],\"time frog pulls on target (ms)\":[462,250,743,844,728,472,959,844,1515,279,1427,2874,4251,626,1254,986,1627,2021,1366,1269],\"total contact area (mm2)\":[133,57,51,142,174,56,65,124,137,60,110,145,191,83,151,117,123,129,128,129],\"trial number\":[2,3,4,1,2,3,1,1,2,3,4,1,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"4221\"},\"selection_policy\":{\"id\":\"4222\"}},\"id\":\"4046\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2834\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2566\"},\"ticker\":{\"id\":\"2535\"}},\"id\":\"2534\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2741\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QAAAAAAAEHhAAAAAAAAQeEAAAAAAABB5QAAAAAAAEHlAAAAAAADgeUAAAAAAAOB5QAAAAAAAoHxAAAAAAACgfEAAAAAAALB8QAAAAAAAsHxAAAAAAACAfkAAAAAAAIB+QAAAAAAAuIBAAAAAAAC4gEAAAAAAANCAQAAAAAAA0IBAAAAAAAAAgUAAAAAAAACBQAAAAAAAAIFAAAAAAAAAgUAAAAAAABiCQAAAAAAAGIJAAAAAAAAYg0AAAAAAABiDQAAAAAAAMINAAAAAAAAwg0AAAAAAADCDQAAAAAAAMINAAAAAAABog0AAAAAAAGiDQAAAAAAAkINAAAAAAACQg0AAAAAAAMiEQAAAAAAAyIRAAAAAAABAiEAAAAAAAECIQAAAAAAAMIlAAAAAAAAwiUA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2709\"},\"selection_policy\":{\"id\":\"2710\"}},\"id\":\"2661\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3444\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2659\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3151\",\"type\":\"Circle\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3743\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"2771\"},\"glyph\":{\"id\":\"2772\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2773\"},\"selection_glyph\":null,\"view\":{\"id\":\"2775\"}},\"id\":\"2774\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2556\"}},\"id\":\"2560\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3312\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"2771\"}},\"id\":\"2775\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2532\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QAAAAAAA0H5AAAAAAADQfkAAAAAAAGCBQAAAAAAAYIFAAAAAAAA4iEAAAAAAADiIQAAAAAAA1JJAAAAAAADUkkAAAAAAAGCTQAAAAAAAYJNAAAAAAAAIlEAAAAAAAAiUQAAAAAAAbJRAAAAAAABslEAAAAAAAByYQAAAAAAAHJhAAAAAAAAkmEAAAAAAACSYQAAAAAAAUJhAAAAAAABQmEAAAAAAAHCaQAAAAAAAcJpAAAAAAABEm0AAAAAAAESbQAAAAAAAjJ1AAAAAAACMnUAAAAAAAKSdQAAAAAAApJ1AAAAAAAAgnkAAAAAAACCeQAAAAAAAwJ9AAAAAAADAn0AAAAAAAMihQAAAAAAAyKFAAAAAAAC+o0AAAAAAAL6jQAAAAAAAoqRAAAAAAACipEA=\",\"dtype\":\"float64\",\"shape\":[40]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACamZmZmZmpP5qZmZmZmak/mpmZmZmZuT+amZmZmZm5PzMzMzMzM8M/MzMzMzMzwz+amZmZmZnJP5qZmZmZmck/AAAAAAAA0D8AAAAAAADQPzMzMzMzM9M/MzMzMzMz0z9mZmZmZmbWP2ZmZmZmZtY/mpmZmZmZ2T+amZmZmZnZP83MzMzMzNw/zczMzMzM3D8AAAAAAADgPwAAAAAAAOA/mpmZmZmZ4T+amZmZmZnhPzMzMzMzM+M/MzMzMzMz4z/NzMzMzMzkP83MzMzMzOQ/ZmZmZmZm5j9mZmZmZmbmPwAAAAAAAOg/AAAAAAAA6D+amZmZmZnpP5qZmZmZmek/MzMzMzMz6z8zMzMzMzPrP83MzMzMzOw/zczMzMzM7D9mZmZmZmbuP2ZmZmZmZu4/AAAAAAAA8D8=\",\"dtype\":\"float64\",\"shape\":[40]}},\"selected\":{\"id\":\"2581\"},\"selection_policy\":{\"id\":\"2582\"}},\"id\":\"2556\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2800\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2561\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"3149\"}},\"id\":\"3154\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2682\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2661\"},\"glyph\":{\"id\":\"2662\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2663\"},\"selection_glyph\":null,\"view\":{\"id\":\"2665\"}},\"id\":\"2664\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3610\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"3149\"},\"glyph\":{\"id\":\"3151\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3152\"},\"selection_glyph\":null,\"view\":{\"id\":\"3154\"}},\"id\":\"3153\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2556\"},\"glyph\":{\"id\":\"2557\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2558\"},\"selection_glyph\":null,\"view\":{\"id\":\"2560\"}},\"id\":\"2559\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2801\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2804\",\"type\":\"Ray\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#d62628\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"4049\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2581\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2539\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2663\",\"type\":\"Line\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2564\"},\"ticker\":{\"id\":\"2539\"}},\"id\":\"2538\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"3442\"}},\"id\":\"3447\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2558\",\"type\":\"Line\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2805\",\"type\":\"Ray\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2664\"},{\"id\":\"2689\"},{\"id\":\"2715\"},{\"id\":\"3745\"}]},\"id\":\"2685\",\"type\":\"LegendItem\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2557\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2683\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3609\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2803\"},\"glyph\":{\"id\":\"2804\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2805\"},\"selection_glyph\":null,\"view\":{\"id\":\"2807\"}},\"id\":\"2806\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2615\"},\"selection_policy\":{\"id\":\"2616\"}},\"id\":\"2584\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2737\"},\"selection_policy\":{\"id\":\"2738\"}},\"id\":\"2686\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"3442\"},\"glyph\":{\"id\":\"3444\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3445\"},\"selection_glyph\":null,\"view\":{\"id\":\"3447\"}},\"id\":\"3446\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2803\"}},\"id\":\"2807\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2688\",\"type\":\"Ray\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"4048\",\"type\":\"Circle\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2621\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2687\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2686\"},\"glyph\":{\"id\":\"2687\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2688\"},\"selection_glyph\":null,\"view\":{\"id\":\"2690\"}},\"id\":\"2689\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2602\",\"type\":\"Line\"}],\"root_ids\":[\"2525\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"f52055da-c73a-4b65-ad27-4954c2d99275\",\"root_ids\":[\"2525\"],\"roots\":{\"2525\":\"bd8de3ea-97e2-40e1-be04-c6ac75c68aab\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2525" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " p=p\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Customization with Bokeh-catplot\n", "\n", "You may have noticed in the discussion of ECDFs that I introduced some new keyword arguments, `style` and `p`. In fact, each of the four plotting functions also has the following additional optional keyword arguments.\n", "\n", "- `palette`: A list of hex colors to use for coloring the markers for each category. By default, it uses the `colorcet.b_glasbey_category10` palette from the [colorcet package](https://colorcet.holoviz.org).\n", "- `order`: If specified, the ordering of the categories to use on the categorical axis and legend (if applicable). Otherwise, the order of the inputted data frame is used.\n", "- `p`: If specified, the `bokeh.plotting.Figure` object to use for the plot. If not specified, a new figure is created.\n", "\n", "The respective plotting functions also have kwargs that are specific to each (such as `style` for `bokeh_catplot.ecdf()`. Examples highlighting some, but not all, customizations follow. You can find out what kwargs are available for each function by reading their doc strings, e.g., with\n", "\n", "```python\n", "bokeh_catplot.box?\n", "```\n", "\n", "Any kwargs not in the function call signature are passed to `bokeh.plotting.figure()` when the figure is instantiated." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customizing box plots\n", "\n", "We can also have horizontal box plots." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"05a72eca-5629-4160-bc60-2833d83f5fc5\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4600\"}],\"center\":[{\"id\":\"4603\"},{\"id\":\"4606\"}],\"left\":[{\"id\":\"4604\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"4629\"},{\"id\":\"4634\"},{\"id\":\"4639\"},{\"id\":\"4644\"},{\"id\":\"4649\"}],\"title\":{\"id\":\"4785\"},\"toolbar\":{\"id\":\"4614\"},\"x_range\":{\"id\":\"4593\"},\"x_scale\":{\"id\":\"4596\"},\"y_range\":{\"id\":\"4591\"},\"y_scale\":{\"id\":\"4598\"}},\"id\":\"4592\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4794\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"4604\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"4606\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"4621\"},\"glyph\":{\"id\":\"4642\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4643\"},\"selection_glyph\":null,\"view\":{\"id\":\"4645\"}},\"id\":\"4644\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4607\"},{\"id\":\"4608\"},{\"id\":\"4609\"},{\"id\":\"4610\"},{\"id\":\"4611\"},{\"id\":\"4612\"}]},\"id\":\"4614\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"4607\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4596\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"4621\"}},\"id\":\"4645\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4608\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"4625\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4623\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4624\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4647\",\"type\":\"Circle\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4628\",\"type\":\"Segment\"},{\"attributes\":{\"overlay\":{\"id\":\"4613\"}},\"id\":\"4609\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"4790\"},\"ticker\":{\"id\":\"4601\"}},\"id\":\"4600\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"4621\"},\"glyph\":{\"id\":\"4637\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4638\"},\"selection_glyph\":null,\"view\":{\"id\":\"4640\"}},\"id\":\"4639\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4601\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4625\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4637\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"4610\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4593\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4642\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"4611\",\"type\":\"ResetTool\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"4624\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"4793\"},\"selection_policy\":{\"id\":\"4794\"}},\"id\":\"4622\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"4621\"}},\"id\":\"4630\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"__label\":[\"I\",\"II\",\"III\",\"IV\"],\"bottom\":[1231.25,422.0,458.75,198.0],\"bottom_whisker\":[473.0,245.0,324.0,22.0],\"cat\":[\"I\",\"II\",\"III\",\"IV\"],\"middle\":[1550.5,573.0,544.0,460.5],\"top\":[1904.75,799.75,615.75,599.0],\"top_whisker\":[2641.0,1182.0,806.0,815.0]},\"selected\":{\"id\":\"4791\"},\"selection_policy\":{\"id\":\"4792\"}},\"id\":\"4621\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4612\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"4792\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"4621\"}},\"id\":\"4640\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"4623\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data_source\":{\"id\":\"4622\"},\"glyph\":{\"id\":\"4647\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4648\"},\"selection_glyph\":null,\"view\":{\"id\":\"4650\"}},\"id\":\"4649\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4627\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"4598\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"source\":{\"id\":\"4622\"}},\"id\":\"4650\",\"type\":\"CDSView\"},{\"attributes\":{\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4632\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"4793\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4790\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4623\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4624\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4648\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"4621\"},\"glyph\":{\"id\":\"4632\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4633\"},\"selection_glyph\":null,\"view\":{\"id\":\"4635\"}},\"id\":\"4634\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4605\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4643\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"4621\"}},\"id\":\"4635\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"4788\"},\"ticker\":{\"id\":\"4605\"}},\"id\":\"4604\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"4785\",\"type\":\"Title\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4633\",\"type\":\"Segment\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4625\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4638\",\"type\":\"HBar\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"4591\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"4788\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"4791\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4613\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"4600\"},\"ticker\":null},\"id\":\"4603\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"4621\"},\"glyph\":{\"id\":\"4627\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4628\"},\"selection_glyph\":null,\"view\":{\"id\":\"4630\"}},\"id\":\"4629\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"4592\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"05a72eca-5629-4160-bc60-2833d83f5fc5\",\"root_ids\":[\"4592\"],\"roots\":{\"4592\":\"6e75a550-60c0-4faf-8ca6-c9937969fe3c\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "4592" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.box(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " horizontal=True,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can independently specify properties of the marks using `box_kwargs`, `whisker_kwargs`, `median_kwargs`, and `outlier_kwargs`. For example, say we wanted our colors to be [Betancourt red](https://betanalpha.github.io/assets/case_studies/principled_bayesian_workflow.html#step_four:_build_a_generative_model19), and that we wanted the outliers to also be that color and use diamond glyphs." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"ae06b793-38df-4da4-aa35-e6ecb3edfc36\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4871\"}],\"center\":[{\"id\":\"4873\"},{\"id\":\"4877\"}],\"left\":[{\"id\":\"4874\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"4897\"},{\"id\":\"4902\"},{\"id\":\"4907\"},{\"id\":\"4912\"},{\"id\":\"4917\"},{\"id\":\"4922\"},{\"id\":\"4927\"}],\"title\":{\"id\":\"5074\"},\"toolbar\":{\"id\":\"4885\"},\"x_range\":{\"id\":\"4862\"},\"x_scale\":{\"id\":\"4867\"},\"y_range\":{\"id\":\"4865\"},\"y_scale\":{\"id\":\"4869\"}},\"id\":\"4863\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"4895\",\"type\":\"Segment\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4900\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4901\"},\"selection_glyph\":null,\"view\":{\"id\":\"4903\"}},\"id\":\"4902\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4915\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4916\"},\"selection_glyph\":null,\"view\":{\"id\":\"4918\"}},\"id\":\"4917\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4915\",\"type\":\"VBar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4884\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4898\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"4862\",\"type\":\"FactorRange\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"4901\",\"type\":\"Segment\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"4926\",\"type\":\"Diamond\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4918\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4878\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4908\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"5082\"},\"selection_policy\":{\"id\":\"5083\"}},\"id\":\"4893\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4916\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"4879\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5082\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"4900\",\"type\":\"Segment\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4921\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"5081\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4920\",\"type\":\"VBar\"},{\"attributes\":{\"overlay\":{\"id\":\"4884\"}},\"id\":\"4880\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4867\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4923\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4881\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4865\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5077\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5079\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":\"#7C0000\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"4925\",\"type\":\"Diamond\"},{\"attributes\":{},\"id\":\"4882\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4883\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5080\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4905\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4906\"},\"selection_glyph\":null,\"view\":{\"id\":\"4908\"}},\"id\":\"4907\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4920\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4921\"},\"selection_glyph\":null,\"view\":{\"id\":\"4923\"}},\"id\":\"4922\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom\":{\"field\":\"top_whisker\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"top_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"4905\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"4869\",\"type\":\"LinearScale\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4878\"},{\"id\":\"4879\"},{\"id\":\"4880\"},{\"id\":\"4881\"},{\"id\":\"4882\"},{\"id\":\"4883\"}]},\"id\":\"4885\",\"type\":\"Toolbar\"},{\"attributes\":{\"data\":{\"__label\":[\"I\",\"II\",\"III\",\"IV\"],\"bottom\":[1231.25,422.0,458.75,198.0],\"bottom_whisker\":[473.0,245.0,324.0,22.0],\"cat\":[\"I\",\"II\",\"III\",\"IV\"],\"middle\":[1550.5,573.0,544.0,460.5],\"top\":[1904.75,799.75,615.75,599.0],\"top_whisker\":[2641.0,1182.0,806.0,815.0]},\"selected\":{\"id\":\"5080\"},\"selection_policy\":{\"id\":\"5081\"}},\"id\":\"4892\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom\":{\"field\":\"top_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"top_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"4906\",\"type\":\"VBar\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"4910\",\"type\":\"VBar\"},{\"attributes\":{\"formatter\":{\"id\":\"5079\"},\"ticker\":{\"id\":\"4872\"}},\"id\":\"4871\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"5074\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4903\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4875\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"4892\"}},\"id\":\"4913\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4872\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"4896\",\"type\":\"Segment\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4910\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4911\"},\"selection_glyph\":null,\"view\":{\"id\":\"4913\"}},\"id\":\"4912\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"4871\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"4873\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"4893\"},\"glyph\":{\"id\":\"4925\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4926\"},\"selection_glyph\":null,\"view\":{\"id\":\"4928\"}},\"id\":\"4927\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"4874\"},\"dimension\":1,\"ticker\":null},\"id\":\"4877\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5083\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5077\"},\"ticker\":{\"id\":\"4875\"}},\"id\":\"4874\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"4911\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"4893\"}},\"id\":\"4928\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"4892\"},\"glyph\":{\"id\":\"4895\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4896\"},\"selection_glyph\":null,\"view\":{\"id\":\"4898\"}},\"id\":\"4897\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"4863\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"ae06b793-38df-4da4-aa35-e6ecb3edfc36\",\"root_ids\":[\"4863\"],\"roots\":{\"4863\":\"50bbb4e3-cb61-4956-b44a-2399d030898c\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "4863" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.box(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " whisker_caps=True,\n", " outlier_marker='diamond',\n", " box_kwargs=dict(fill_color='#7C0000'),\n", " whisker_kwargs=dict(line_color='#7C0000', line_width=2),\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Custominzing strip plots\n", "\n", "To help alleviate the overlap problem, we can make a strip plot with dash markers and add some transparency." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"3dc4599f-98e2-464b-b60e-5da510ee5bd7\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5160\"}],\"center\":[{\"id\":\"5162\"},{\"id\":\"5166\"}],\"left\":[{\"id\":\"5163\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"5186\"}],\"title\":{\"id\":\"5344\"},\"toolbar\":{\"id\":\"5174\"},\"x_range\":{\"id\":\"5151\"},\"x_scale\":{\"id\":\"5156\"},\"y_range\":{\"id\":\"5154\"},\"y_scale\":{\"id\":\"5158\"}},\"id\":\"5152\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"5182\"}},\"id\":\"5187\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5158\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"5170\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"5182\"},\"glyph\":{\"id\":\"5184\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5185\"},\"selection_glyph\":null,\"view\":{\"id\":\"5187\"}},\"id\":\"5186\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text\":\"\"},\"id\":\"5344\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5171\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5181\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5181\"}},\"size\":{\"units\":\"screen\",\"value\":25.0},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5185\",\"type\":\"Dash\"},{\"attributes\":{},\"id\":\"5172\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5156\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"axis\":{\"id\":\"5160\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"5162\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5347\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5154\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"5163\"},\"dimension\":1,\"ticker\":null},\"id\":\"5166\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"5349\"},\"ticker\":{\"id\":\"5161\"}},\"id\":\"5160\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"5181\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5347\"},\"ticker\":{\"id\":\"5164\"}},\"id\":\"5163\",\"type\":\"LinearAxis\"},{\"attributes\":{\"overlay\":{\"id\":\"5173\"}},\"id\":\"5169\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5181\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5181\"}},\"size\":{\"units\":\"screen\",\"value\":25.0},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5184\",\"type\":\"Dash\"},{\"attributes\":{},\"id\":\"5168\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"5151\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"5161\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"5351\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5173\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5350\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"5349\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5167\"},{\"id\":\"5168\"},{\"id\":\"5169\"},{\"id\":\"5170\"},{\"id\":\"5171\"},{\"id\":\"5172\"}]},\"id\":\"5174\",\"type\":\"Toolbar\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"cat\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473,1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730,614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488,172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468]},\"selected\":{\"id\":\"5350\"},\"selection_policy\":{\"id\":\"5351\"}},\"id\":\"5182\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5167\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5164\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"5152\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"3dc4599f-98e2-464b-b60e-5da510ee5bd7\",\"root_ids\":[\"5152\"],\"roots\":{\"5152\":\"116262fd-fd7f-44b8-b11d-8dd7abc5b41d\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "5152" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " marker='dash',\n", " marker_kwargs=dict(alpha=0.5)\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The problem with strip plots is that they can have trouble with overlapping data points. A common approach to deal with this is to \"**jitter**,\" or place the glyphs with small random displacements along the categorical axis. I do that here, allowing for hover tools that give more information about the respective data points." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"65001b4e-b092-4c0c-a37d-ca046c066e93\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5416\"}],\"center\":[{\"id\":\"5418\"},{\"id\":\"5422\"}],\"left\":[{\"id\":\"5419\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"5445\"}],\"title\":{\"id\":\"5612\"},\"toolbar\":{\"id\":\"5430\"},\"x_range\":{\"id\":\"5407\"},\"x_scale\":{\"id\":\"5412\"},\"y_range\":{\"id\":\"5410\"},\"y_scale\":{\"id\":\"5414\"}},\"id\":\"5408\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"5428\",\"type\":\"HelpTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5617\"},\"ticker\":{\"id\":\"5417\"}},\"id\":\"5416\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5429\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"5440\"},\"glyph\":{\"id\":\"5443\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5444\"},\"selection_glyph\":null,\"view\":{\"id\":\"5446\"}},\"id\":\"5445\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"5407\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"5615\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"trial\",\"@{trial number}\"],[\"adh force\",\"@{adhesive force (mN)}\"]]},\"id\":\"5437\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"5420\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5417\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"5410\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5439\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5439\"}},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"5441\"}},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5444\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"adhesive force (mN)\":[-785,-983,-850,-455,-974,-592,-512,-804,-690,-462,-766,-715,-613,-677,-528,-452,-430,-652,-692,-536,-655,-292,-246,-245,-553,-664,-261,-691,-92,-566,-223,-512,-227,-573,-522,-599,-364,-469,-844,-648,-94,-163,-172,-225,-301,-93,-131,-289,-104,-229,-259,-231,-267,-178,-123,-151,-127,-372,-236,-390,-456,-193,-236,-225,-217,-161,-139,-264,-342,-231,-209,-292,-339,-371,-331,-302,-216,-163,-367,-218],\"cat\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473,1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730,614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488,172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468],\"trial number\":[3,4,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5,1,2,3,4,1,2,3,4,1,2,3,4,1,2,1,2,1,2,3,1,1,2,3,1,2,3,1,2,1,2,3,4,1,2,3,4,1,2,3,4,2,3,4,1,2,3,1,1,2,3,4,1,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"5618\"},\"selection_policy\":{\"id\":\"5619\"}},\"id\":\"5440\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis\":{\"id\":\"5416\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"5418\",\"type\":\"Grid\"},{\"attributes\":{\"axis\":{\"id\":\"5419\"},\"dimension\":1,\"ticker\":null},\"id\":\"5422\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"5440\"}},\"id\":\"5446\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5615\"},\"ticker\":{\"id\":\"5420\"}},\"id\":\"5419\",\"type\":\"LinearAxis\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"5407\"},\"width\":0.1},\"id\":\"5441\",\"type\":\"Jitter\"},{\"attributes\":{},\"id\":\"5412\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"5439\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"5619\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"\"},\"id\":\"5612\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5423\"},{\"id\":\"5424\"},{\"id\":\"5425\"},{\"id\":\"5426\"},{\"id\":\"5427\"},{\"id\":\"5428\"},{\"id\":\"5437\"}]},\"id\":\"5430\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5423\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5424\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5617\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"5414\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"5429\"}},\"id\":\"5425\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5439\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5439\"}},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"5441\"}},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5443\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5426\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5427\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"5618\",\"type\":\"Selection\"}],\"root_ids\":[\"5408\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"65001b4e-b092-4c0c-a37d-ca046c066e93\",\"root_ids\":[\"5408\"],\"roots\":{\"5408\":\"a9f60126-0225-4af5-afbd-97ea5738205d\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "5408" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " jitter=True,\n", " tooltips=[\n", " ('trial', '@{trial number}'),\n", " ('adh force', '@{adhesive force (mN)}')\n", " ],\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With any of the plots, you can have more than one categorical column, and the categorical axes are nicely spaced and formatted. Here, we'll categorize by frog ID and by trial number." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"bda1def4-e3af-4d94-8268-ec60e49f1854\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5684\"}],\"center\":[{\"id\":\"5686\"},{\"id\":\"5690\"}],\"left\":[{\"id\":\"5687\"}],\"plot_height\":300,\"plot_width\":550,\"renderers\":[{\"id\":\"5710\"}],\"title\":{\"id\":\"5886\"},\"toolbar\":{\"id\":\"5698\"},\"x_range\":{\"id\":\"5675\"},\"x_scale\":{\"id\":\"5680\"},\"y_range\":{\"id\":\"5678\"},\"y_scale\":{\"id\":\"5682\"}},\"id\":\"5676\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"5706\"},\"glyph\":{\"id\":\"5708\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5709\"},\"selection_glyph\":null,\"view\":{\"id\":\"5711\"}},\"id\":\"5710\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"formatter\":{\"id\":\"5891\"},\"ticker\":{\"id\":\"5685\"}},\"id\":\"5684\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"5680\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"source\":{\"id\":\"5706\"}},\"id\":\"5711\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__label\":[\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"5\",\"1\",\"2\",\"3\",\"4\",\"5\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"3\",\"1\",\"1\",\"2\",\"3\",\"1\",\"2\",\"3\",\"1\",\"2\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"1\",\"1\",\"2\",\"3\",\"4\",\"1\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\"],\"cat\":[[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"1\"],[\"I\",\"2\"],[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"1\"],[\"I\",\"2\"],[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"1\"],[\"I\",\"2\"],[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"5\"],[\"I\",\"1\"],[\"I\",\"2\"],[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"5\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"3\"],[\"II\",\"4\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"3\"],[\"II\",\"4\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"3\"],[\"II\",\"4\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"3\"],[\"II\",\"1\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"4\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"4\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"4\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"4\"],[\"IV\",\"1\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"1\"],[\"IV\",\"1\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"4\"],[\"IV\",\"1\"],[\"IV\",\"1\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"4\"],[\"IV\",\"1\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"4\"]],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473,1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730,614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488,172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468],\"trial number\":[\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"5\",\"1\",\"2\",\"3\",\"4\",\"5\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"3\",\"1\",\"1\",\"2\",\"3\",\"1\",\"2\",\"3\",\"1\",\"2\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"1\",\"1\",\"2\",\"3\",\"4\",\"1\",\"1\",\"2\",\"3\",\"4\",\"1\",\"2\",\"3\",\"4\"]},\"selected\":{\"id\":\"5892\"},\"selection_policy\":{\"id\":\"5893\"}},\"id\":\"5706\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5697\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5691\"},{\"id\":\"5692\"},{\"id\":\"5693\"},{\"id\":\"5694\"},{\"id\":\"5695\"},{\"id\":\"5696\"}]},\"id\":\"5698\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5893\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"5682\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"5886\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5685\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"5691\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5678\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5688\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5891\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"5692\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5705\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5705\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5709\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5889\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"5697\"}},\"id\":\"5693\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5694\",\"type\":\"SaveTool\"},{\"attributes\":{\"factors\":[\"1\",\"2\",\"3\",\"4\",\"5\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"5705\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5889\"},\"ticker\":{\"id\":\"5688\"}},\"id\":\"5687\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"5684\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"5686\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5695\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"5687\"},\"dimension\":1,\"ticker\":null},\"id\":\"5690\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5696\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5705\"}},\"line_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5705\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"5708\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5892\",\"type\":\"Selection\"},{\"attributes\":{\"factors\":[[\"I\",\"1\"],[\"I\",\"2\"],[\"I\",\"3\"],[\"I\",\"4\"],[\"I\",\"5\"],[\"II\",\"1\"],[\"II\",\"2\"],[\"II\",\"3\"],[\"II\",\"4\"],[\"III\",\"1\"],[\"III\",\"2\"],[\"III\",\"3\"],[\"III\",\"4\"],[\"IV\",\"1\"],[\"IV\",\"2\"],[\"IV\",\"3\"],[\"IV\",\"4\"]]},\"id\":\"5675\",\"type\":\"FactorRange\"}],\"root_ids\":[\"5676\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"bda1def4-e3af-4d94-8268-ec60e49f1854\",\"root_ids\":[\"5676\"],\"roots\":{\"5676\":\"d5d32f62-235a-4eab-b816-de725d2e7dd5\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "5676" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats=['ID', 'trial number'],\n", " val='impact force (mN)',\n", " color_column='trial number',\n", " width=550,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Strip-box plots\n", "\n", "Even while plotting all of the data, we sometimes want to graphically display summary statistics, in which case overlaying a box plot and a jitter plot is useful. To populate an existing Bokeh figure with new glyphs from another catplot, pass in the `p` kwarg. You should be careful, though, because you need to make sure the `cats`, `val`, and `horizontal` arguments exactly match." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"6bb66bc0-cd8b-4305-950e-24625db096d2\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5958\"}],\"center\":[{\"id\":\"5961\"},{\"id\":\"5964\"}],\"frame_height\":250,\"left\":[{\"id\":\"5962\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"5985\"},{\"id\":\"5993\"},{\"id\":\"5998\"},{\"id\":\"6003\"},{\"id\":\"6008\"},{\"id\":\"6013\"},{\"id\":\"6018\"}],\"title\":{\"id\":\"6203\"},\"toolbar\":{\"id\":\"5972\"},\"x_range\":{\"id\":\"5951\"},\"x_scale\":{\"id\":\"5954\"},\"y_range\":{\"id\":\"5949\"},\"y_scale\":{\"id\":\"5956\"}},\"id\":\"5950\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"6001\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6002\"},\"selection_glyph\":null,\"view\":{\"id\":\"6004\"}},\"id\":\"6003\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6017\",\"type\":\"HBar\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"],\"palette\":[\"#1f77b3\",\"#ff7e0e\",\"#2ba02b\",\"#d62628\",\"#9367bc\",\"#8c564b\",\"#e277c1\",\"#7e7e7e\",\"#bcbc21\",\"#16bdcf\",\"#3a0182\",\"#004201\",\"#0fffa8\",\"#5d003f\",\"#bcbcff\",\"#d8afa1\",\"#b80080\",\"#004d52\",\"#6b6400\",\"#7c0100\",\"#6026ff\",\"#ffff9a\",\"#564964\",\"#8cb893\",\"#93fbff\",\"#018267\",\"#90ff00\",\"#8200a0\",\"#ac8944\",\"#5b3400\",\"#ffbff2\",\"#ff6e75\",\"#798cff\",\"#dd00ff\",\"#505646\",\"#004489\",\"#ffbf60\",\"#ff018c\",\"#bdc8cf\",\"#af97b5\",\"#b65600\",\"#017000\",\"#cd87ff\",\"#1cd646\",\"#bfebc3\",\"#7997b5\",\"#a56089\",\"#6e8956\",\"#bc7c75\",\"#8a2844\",\"#00acff\",\"#8ed4ff\",\"#4b6d77\",\"#00d4b1\",\"#9300f2\",\"#8a9500\",\"#5d5b9e\",\"#fddfba\",\"#00939e\",\"#ffdb00\",\"#00aa79\",\"#520067\",\"#000091\",\"#0a5d3d\",\"#a5e275\",\"#623b41\",\"#c6c689\",\"#ff9eb5\",\"#cd4f6b\",\"#ff07d6\",\"#8a3a05\",\"#7e3d70\",\"#ff4901\",\"#602ba5\",\"#1c00ff\",\"#e6dfff\",\"#aa3baf\",\"#d89c00\",\"#a3a39e\",\"#3f69ff\",\"#46490c\",\"#7b6985\",\"#6b978c\",\"#ff9a75\",\"#835bff\",\"#7c6b46\",\"#80b654\",\"#bc0049\",\"#fd93ff\",\"#5d0018\",\"#89d1d1\",\"#9c8cd3\",\"#da6d42\",\"#8a5700\",\"#3b5069\",\"#4b6b3b\",\"#edcfd8\",\"#cfedff\",\"#aa1500\",\"#dfff4f\",\"#ff2a56\",\"#d1499e\",\"#707cb8\",\"#598000\",\"#00e4fd\",\"#774b95\",\"#67d48c\",\"#3d3a72\",\"#ac413f\",\"#d6a166\",\"#c169cd\",\"#69595d\",\"#87aced\",\"#a0a569\",\"#d1aae6\",\"#870062\",\"#00fddb\",\"#672818\",\"#b342ff\",\"#0e59c4\",\"#168742\",\"#90d300\",\"#cd7900\",\"#f959ff\",\"#5b7466\",\"#8eaeb3\",\"#9c7c8c\",\"#4600c6\",\"#6b4d2d\",\"#a56d46\",\"#9e8972\",\"#a8afca\",\"#cd8ca7\",\"#00fd64\",\"#917900\",\"#ff62a1\",\"#f4ffd8\",\"#018cf0\",\"#13aca0\",\"#5b2d59\",\"#89859e\",\"#cfccba\",\"#d4afc4\",\"#dbdd6d\",\"#cffff4\",\"#006485\",\"#006962\",\"#a84167\",\"#2d97c4\",\"#a874ff\",\"#26ba5d\",\"#57b600\",\"#caffa7\",\"#a379aa\",\"#ffbc93\",\"#89e2c1\",\"#0fc8ff\",\"#d400c4\",\"#626d89\",\"#69858e\",\"#4b4d52\",\"#aa6067\",\"#79b5d4\",\"#2b5916\",\"#9a0024\",\"#bdd1f2\",\"#896e67\",\"#69a56b\",\"#855467\",\"#aecdba\",\"#87997e\",\"#cadb00\",\"#9a0390\",\"#ebbc1a\",\"#eb9cd1\",\"#70006e\",\"#b1a131\",\"#ca6b93\",\"#4146a3\",\"#e48c89\",\"#d44400\",\"#c68aca\",\"#b69597\",\"#d41f75\",\"#724bcc\",\"#674d00\",\"#672138\",\"#38564f\",\"#6ebaaa\",\"#853a31\",\"#a5d397\",\"#b8af8e\",\"#d8e4df\",\"#aa00df\",\"#cac1db\",\"#ffdf8c\",\"#e2524d\",\"#66696e\",\"#ff001c\",\"#522d72\",\"#4d906b\",\"#a86d11\",\"#ff9e26\",\"#5ea3af\",\"#c88556\",\"#915997\",\"#a3a1ff\",\"#fdbaba\",\"#242a87\",\"#dbe6a8\",\"#97f2a7\",\"#6793d6\",\"#ba5b3f\",\"#3a5d91\",\"#364f2f\",\"#267c95\",\"#89959a\",\"#cfb356\",\"#004664\",\"#5e5d2f\",\"#8e8e41\",\"#ac3f13\",\"#69953b\",\"#a13d85\",\"#bfb6ba\",\"#acc667\",\"#6469cf\",\"#91af00\",\"#2be2da\",\"#016e36\",\"#ff7952\",\"#42807e\",\"#4fe800\",\"#995428\",\"#5d0a00\",\"#a30057\",\"#0c8700\",\"#5982a7\",\"#ffebfb\",\"#4b6901\",\"#8775d4\",\"#e6c6ff\",\"#a5ffda\",\"#d86e77\",\"#df014b\",\"#69675b\",\"#776ba1\",\"#7e8067\",\"#594685\",\"#0000ca\",\"#7c002a\",\"#97ff72\",\"#b5e2e1\",\"#db52c8\",\"#777734\",\"#57bd8e\"]},\"id\":\"5979\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"6006\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6007\"},\"selection_glyph\":null,\"view\":{\"id\":\"6009\"}},\"id\":\"6008\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"5949\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"5965\",\"type\":\"PanTool\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"5996\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"6009\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"6209\",\"type\":\"Selection\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"bottom_whisker\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"bottom_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6006\",\"type\":\"HBar\"},{\"attributes\":{\"fill_color\":{\"value\":null},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6011\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"5966\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"6208\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"bottom_whisker\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"bottom_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6007\",\"type\":\"HBar\"},{\"attributes\":{\"overlay\":{\"id\":\"5971\"}},\"id\":\"5967\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"6210\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"5994\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5968\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5951\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5969\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"__label\":[\"I\",\"II\",\"III\",\"IV\"],\"bottom\":[1231.25,422.0,458.75,198.0],\"bottom_whisker\":[473.0,245.0,324.0,22.0],\"cat\":[\"I\",\"II\",\"III\",\"IV\"],\"middle\":[1550.5,573.0,544.0,460.5],\"top\":[1904.75,799.75,615.75,599.0],\"top_whisker\":[2641.0,1182.0,806.0,815.0]},\"selected\":{\"id\":\"6211\"},\"selection_policy\":{\"id\":\"6212\"}},\"id\":\"5988\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5956\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"6011\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6012\"},\"selection_glyph\":null,\"view\":{\"id\":\"6014\"}},\"id\":\"6013\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5979\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5979\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"5981\"}}},\"id\":\"5983\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5954\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"5997\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"5970\",\"type\":\"HelpTool\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"5949\"},\"width\":0.1},\"id\":\"5981\",\"type\":\"Jitter\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"6208\"},\"ticker\":{\"id\":\"5959\"}},\"id\":\"5958\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"5991\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"6014\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5971\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6016\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"5999\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"5996\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5997\"},\"selection_glyph\":null,\"view\":{\"id\":\"5999\"}},\"id\":\"5998\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"cat\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473,1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730,614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488,172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468]},\"selected\":{\"id\":\"6209\"},\"selection_policy\":{\"id\":\"6210\"}},\"id\":\"5980\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":null},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6012\",\"type\":\"HBar\"},{\"attributes\":{\"axis\":{\"id\":\"5962\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"5964\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5965\"},{\"id\":\"5966\"},{\"id\":\"5967\"},{\"id\":\"5968\"},{\"id\":\"5969\"},{\"id\":\"5970\"}]},\"id\":\"5972\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5959\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"6004\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"top_whisker\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6001\",\"type\":\"HBar\"},{\"attributes\":{\"axis\":{\"id\":\"5958\"},\"ticker\":null},\"id\":\"5961\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"6016\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6017\"},\"selection_glyph\":null,\"view\":{\"id\":\"6019\"}},\"id\":\"6018\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6212\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"5963\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"5992\",\"type\":\"Segment\"},{\"attributes\":{\"formatter\":{\"id\":\"6206\"},\"ticker\":{\"id\":\"5963\"}},\"id\":\"5962\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5979\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5979\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"5981\"}}},\"id\":\"5984\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"5988\"}},\"id\":\"6019\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"6203\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"5988\"},\"glyph\":{\"id\":\"5991\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5992\"},\"selection_glyph\":null,\"view\":{\"id\":\"5994\"}},\"id\":\"5993\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6206\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"5980\"}},\"id\":\"5986\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"6211\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"5980\"},\"glyph\":{\"id\":\"5983\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5984\"},\"selection_glyph\":null,\"view\":{\"id\":\"5986\"}},\"id\":\"5985\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"top_whisker\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"6002\",\"type\":\"HBar\"}],\"root_ids\":[\"5950\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"6bb66bc0-cd8b-4305-950e-24625db096d2\",\"root_ids\":[\"5950\"],\"roots\":{\"5950\":\"93422546-9ab3-454b-aff4-863ad8f39436\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "5950" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " horizontal=True,\n", " jitter=True,\n", " frame_height=250,\n", ")\n", "\n", "p = bokeh_catplot.box(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " horizontal=True,\n", " whisker_caps=True,\n", " display_points=False,\n", " box_kwargs=dict(fill_color=None, line_color='gray'),\n", " median_kwargs=dict(line_color='gray'),\n", " whisker_kwargs=dict(line_color='gray'),\n", " p=p,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customizing histograms\n", "\n", "We could plot normalized histograms using the density kwarg." ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"6ead36f9-2b9a-4a76-9504-7ff2e92b5d5e\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"6289\"}],\"center\":[{\"id\":\"6292\"},{\"id\":\"6296\"},{\"id\":\"6323\"}],\"left\":[{\"id\":\"6293\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"6314\"},{\"id\":\"6328\"}],\"title\":{\"id\":\"6316\"},\"toolbar\":{\"id\":\"6304\"},\"x_range\":{\"id\":\"6282\"},\"x_scale\":{\"id\":\"6285\"},\"y_range\":{\"id\":\"6280\"},\"y_scale\":{\"id\":\"6287\"}},\"id\":\"6281\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"pW4ehO02CMClbh6E7TYIwEdno3d+OwXAR2ejd347BcDpXyhrD0ACwOlfKGsPQALAFrFavUCJ/r8WsVq9QIn+v1qiZKRikvi/WqJkpGKS+L+ek26LhJvyv56TbouEm/K/xAnx5ExJ6b/ECfHkTEnpv5jYCWYht9q/mNgJZiG32r9A7YwRSN2mv0DtjBFI3aa/SJ2mYc//1D9InaZhz//UPxxsv+KjbeY/HGy/4qNt5j/KxFUKsC3xP8rEVQqwLfE/htNLI44k9z+G00sjjiT3P0LiQTxsG/0/QuJBPGwb/T9/+JsqJYkBQH/4myoliQFA3f8WN5SEBEDd/xY3lIQEQDwHkkMDgAdAPAeSQwOAB0A=\",\"dtype\":\"float64\",\"shape\":[34]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACaSmy42vmVP5pKbLja+ZU/QV2HZlF4mz9BXYdmUXibP5PmlL2MN64/k+aUvYw3rj+XmAC7sxi6P5eYALuzGLo/Ruio4gtKxT9G6KjiC0rFP0maFOAyK9E/SZoU4DIr0T+d/Ne1AdvRP53817UB29E/cJmKTfOh1T9wmYpN86HVP5lxtjlHCdg/mXG2OUcJ2D/xheUMPZrUP/GF5Qw9mtQ/yK25IOky0j/Irbkg6TLSP0I2PeXkaMk/QjY95eRoyT89qxtpKpe/Pz2rG2kql78/QV2HZlF4qz9BXYdmUXirP0Fdh2ZReKs/QV2HZlF4qz+SSmy42vmFP5JKbLja+YU/AAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[34]}},\"selected\":{\"id\":\"6336\"},\"selection_policy\":{\"id\":\"6337\"}},\"id\":\"6311\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text\":\"\"},\"id\":\"6316\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"6311\"},\"glyph\":{\"id\":\"6312\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6313\"},\"selection_glyph\":null,\"view\":{\"id\":\"6315\"}},\"id\":\"6314\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6282\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"6311\"}},\"id\":\"6315\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"6300\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"6542\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"6303\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"items\":[{\"id\":\"6324\"}],\"visible\":false},\"id\":\"6323\",\"type\":\"Legend\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6313\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"6294\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"6325\"}},\"id\":\"6329\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\" \"},\"renderers\":[{\"id\":\"6314\"},{\"id\":\"6328\"}]},\"id\":\"6324\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"6287\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"6301\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"6293\"},\"dimension\":1,\"ticker\":null},\"id\":\"6296\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6326\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"6297\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"6303\"}},\"id\":\"6299\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"6319\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"6337\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"start\":0},\"id\":\"6280\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6327\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"6325\"},\"glyph\":{\"id\":\"6326\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6327\"},\"selection_glyph\":null,\"view\":{\"id\":\"6329\"}},\"id\":\"6328\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6312\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"6298\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"6290\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"6302\",\"type\":\"HelpTool\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"pW4ehO02CMClbh6E7TYIwEdno3d+OwXAR2ejd347BcDpXyhrD0ACwOlfKGsPQALAFrFavUCJ/r8WsVq9QIn+v1qiZKRikvi/WqJkpGKS+L+ek26LhJvyv56TbouEm/K/xAnx5ExJ6b/ECfHkTEnpv5jYCWYht9q/mNgJZiG32r9A7YwRSN2mv0DtjBFI3aa/SJ2mYc//1D9InaZhz//UPxxsv+KjbeY/HGy/4qNt5j/KxFUKsC3xP8rEVQqwLfE/htNLI44k9z+G00sjjiT3P0LiQTxsG/0/QuJBPGwb/T9/+JsqJYkBQH/4myoliQFA3f8WN5SEBEDd/xY3lIQEQDwHkkMDgAdAPAeSQwOAB0A8B5JDA4AHQKVuHoTtNgjA\",\"dtype\":\"float64\",\"shape\":[36]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACaSmy42vmVP5pKbLja+ZU/QV2HZlF4mz9BXYdmUXibP5PmlL2MN64/k+aUvYw3rj+XmAC7sxi6P5eYALuzGLo/Ruio4gtKxT9G6KjiC0rFP0maFOAyK9E/SZoU4DIr0T+d/Ne1AdvRP53817UB29E/cJmKTfOh1T9wmYpN86HVP5lxtjlHCdg/mXG2OUcJ2D/xheUMPZrUP/GF5Qw9mtQ/yK25IOky0j/Irbkg6TLSP0I2PeXkaMk/QjY95eRoyT89qxtpKpe/Pz2rG2kql78/QV2HZlF4qz9BXYdmUXirP0Fdh2ZReKs/QV2HZlF4qz+SSmy42vmFP5JKbLja+YU/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[36]}},\"selected\":{\"id\":\"6541\"},\"selection_policy\":{\"id\":\"6542\"}},\"id\":\"6325\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"6321\"},\"ticker\":{\"id\":\"6290\"}},\"id\":\"6289\",\"type\":\"LinearAxis\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"6297\"},{\"id\":\"6298\"},{\"id\":\"6299\"},{\"id\":\"6300\"},{\"id\":\"6301\"},{\"id\":\"6302\"}]},\"id\":\"6304\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"6289\"},\"ticker\":null},\"id\":\"6292\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"6285\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"6541\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"density\",\"formatter\":{\"id\":\"6319\"},\"ticker\":{\"id\":\"6294\"}},\"id\":\"6293\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"6321\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"6336\",\"type\":\"Selection\"}],\"root_ids\":[\"6281\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"6ead36f9-2b9a-4a76-9504-7ff2e92b5d5e\",\"root_ids\":[\"6281\"],\"roots\":{\"6281\":\"f5c42898-1605-4b20-8fd3-0378168a41fe\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "6281" } }, "output_type": "display_data" } ], "source": [ "# Plot the histogram\n", "p = bokeh_catplot.histogram(\n", " data=df_norm,\n", " cats=None,\n", " val='x',\n", " density=True,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customizing ECDFs\n", "\n", "Instead of plotting a separate ECDF for each category, we can put all of the categories together on one ECDF and color the points by the categorical variable by using the `kind='colored'` kwarg. Note that if we do this, we can only have the \"dot\" style ECDF, not the staircase." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"0008786e-f41f-4489-afcd-6c9e44ccfb4d\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"6619\"}],\"center\":[{\"id\":\"6622\"},{\"id\":\"6626\"},{\"id\":\"6654\"}],\"left\":[{\"id\":\"6623\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"6645\"},{\"id\":\"6660\"},{\"id\":\"6676\"},{\"id\":\"6694\"}],\"title\":{\"id\":\"6647\"},\"toolbar\":{\"id\":\"6634\"},\"x_range\":{\"id\":\"6611\"},\"x_scale\":{\"id\":\"6615\"},\"y_range\":{\"id\":\"6613\"},\"y_scale\":{\"id\":\"6617\"}},\"id\":\"6610\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"6627\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"6706\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"6669\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"6672\"},\"glyph\":{\"id\":\"6674\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6675\"},\"selection_glyph\":null,\"view\":{\"id\":\"6677\"}},\"id\":\"6676\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"6655\"},{\"id\":\"6671\"},{\"id\":\"6689\"},{\"id\":\"6709\"}],\"location\":\"bottom_right\"},\"id\":\"6654\",\"type\":\"Legend\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"6652\"},\"ticker\":{\"id\":\"6620\"}},\"id\":\"6619\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"6686\",\"type\":\"Selection\"},{\"attributes\":{\"axis\":{\"id\":\"6623\"},\"dimension\":1,\"ticker\":null},\"id\":\"6626\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"6656\"}},\"id\":\"6661\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"__ECDF\":{\"__ndarray__\":\"ZmZmZmZm7D9mZmZmZmbgPzMzMzMzM8M/AAAAAAAA6D8zMzMzMzPbP83MzMzMzOo/zczMzMzM2D+amZmZmZnjP2ZmZmZmZuo/AAAAAAAAwD9mZmZmZmbkP5qZmZmZmbk/AAAAAAAA5j9mZmZmZma2P2ZmZmZmZug/MzMzMzMz1z9mZmZmZmbOP2ZmZmZmZsY/zczMzMzM0D+amZmZmZnlPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,605,327,946,541,1539,529,628,1453,297,703,269,751,245,1182,515,435,383,457,730],\"index\":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]},\"selected\":{\"id\":\"6686\"},\"selection_policy\":{\"id\":\"6687\"}},\"id\":\"6656\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"6656\"},\"glyph\":{\"id\":\"6658\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6659\"},\"selection_glyph\":null,\"view\":{\"id\":\"6661\"}},\"id\":\"6660\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"6694\"}]},\"id\":\"6709\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6643\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6707\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6674\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#d62628\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6693\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"6672\"}},\"id\":\"6677\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6659\",\"type\":\"Circle\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"6650\"},\"ticker\":{\"id\":\"6624\"}},\"id\":\"6623\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"6641\"}},\"id\":\"6646\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6658\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6928\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"6619\"},\"ticker\":null},\"id\":\"6622\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"6624\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"6660\"}]},\"id\":\"6671\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"6676\"}]},\"id\":\"6689\",\"type\":\"LegendItem\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"6633\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"6613\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"6641\"},\"glyph\":{\"id\":\"6643\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6644\"},\"selection_glyph\":null,\"view\":{\"id\":\"6646\"}},\"id\":\"6645\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6611\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"__ECDF\":{\"__ndarray__\":\"zczMzMzM6D+amZmZmZnvPzMzMzMzM+0/AAAAAAAA7D+amZmZmZnVPzMzMzMzM+8/mpmZmZmZ3T9mZmZmZmbuPwAAAAAAAPA/AAAAAAAA7j+amZmZmZntP5qZmZmZmes/AAAAAAAA6j/NzMzMzMzsPzMzMzMzM+s/mpmZmZmZ6T9mZmZmZmbmP83MzMzMzO4/MzMzMzMz6T8AAAAAAADUPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"impact force (mN)\":[1205,2527,1745,1556,493,2276,556,1928,2641,1897,1891,1545,1307,1692,1543,1282,775,2032,1240,473],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]},\"selected\":{\"id\":\"6668\"},\"selection_policy\":{\"id\":\"6669\"}},\"id\":\"6641\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"6620\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b3\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6644\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6617\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"6687\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"6650\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#2ba02b\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6675\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6668\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"6647\",\"type\":\"Title\"},{\"attributes\":{\"overlay\":{\"id\":\"6633\"}},\"id\":\"6629\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6692\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6630\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"6927\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"6690\"},\"glyph\":{\"id\":\"6692\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6693\"},\"selection_glyph\":null,\"view\":{\"id\":\"6695\"}},\"id\":\"6694\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6628\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"6615\",\"type\":\"LinearScale\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"6627\"},{\"id\":\"6628\"},{\"id\":\"6629\"},{\"id\":\"6630\"},{\"id\":\"6631\"},{\"id\":\"6632\"}]},\"id\":\"6634\",\"type\":\"Toolbar\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"6645\"}]},\"id\":\"6655\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"ID\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"__ECDF\":{\"__ndarray__\":\"mpmZmZmZ4T/NzMzMzMzMP5qZmZmZmcE/zczMzMzM5j8zMzMzMzPhPwAAAAAAANw/ZmZmZmZm2j9mZmZmZmbePzMzMzMzM+c/ZmZmZmZm0j+amZmZmZnRPzMzMzMzM+M/zczMzMzM4j/NzMzMzMzcP5qZmZmZmdk/AAAAAAAAyD+amZmZmZnJPwAAAAAAAOI/AAAAAAAA5D/NzMzMzMzUPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\",\"III\"],\"impact force (mN)\":[614,414,324,776,611,544,538,579,806,459,458,626,621,544,535,385,401,614,665,488],\"index\":[40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]},\"selected\":{\"id\":\"6706\"},\"selection_policy\":{\"id\":\"6707\"}},\"id\":\"6672\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"6652\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"6690\"}},\"id\":\"6695\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"ID\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"__ECDF\":{\"__ndarray__\":\"mpmZmZmZqT8zMzMzMzOjP5qZmZmZmZk/AAAAAAAA0D/NzMzMzMzEP5qZmZmZmYk/ZmZmZmZm1j/NzMzMzMy8PzMzMzMzM+U/MzMzMzMz3z8AAAAAAACwPzMzMzMzM7M/AAAAAAAA4D8AAAAAAADYP5qZmZmZmec/MzMzMzMzyz/NzMzMzMzgP83MzMzMzOQ/ZmZmZmZm4j8zMzMzMzPTPw==\",\"dtype\":\"float64\",\"shape\":[20]},\"__label\":[\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\",\"IV\"],\"impact force (mN)\":[172,142,37,453,355,22,502,273,720,582,198,198,597,516,815,402,605,711,614,468],\"index\":[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]},\"selected\":{\"id\":\"6927\"},\"selection_policy\":{\"id\":\"6928\"}},\"id\":\"6690\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"6632\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"6631\",\"type\":\"ResetTool\"}],\"root_ids\":[\"6610\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.2\"}};\n", " var render_items = [{\"docid\":\"0008786e-f41f-4489-afcd-6c9e44ccfb4d\",\"root_ids\":[\"6610\"],\"roots\":{\"6610\":\"c885bfe4-c24d-4b12-b3f1-1ea161d7f859\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "6610" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats='ID',\n", " val='impact force (mN)',\n", " kind='colored',\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Don't make bar graphs\n", "\n", "Bar graphs, especially with error bars (in which case they are called dynamite plots), are typically awful. They are pervasive in biology papers. I have yet to find a single example where a bar graph is the best choice. Strip plots (with jitter) or even box plots, are more informative and almost always preferred. In fact, ECDFs are often better even than these. Here is a simple message:\n", "\n", "
\n", " \n", "Don't make bar graphs.\n", " \n", "
\n", "\n", "What should I do instead you ask? The answer is simple: **plot all of your data** when you can. If you can't, box plots are always better than bar graphs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing environment" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPython 3.7.7\n", "IPython 7.13.0\n", "\n", "numpy 1.18.1\n", "pandas 0.24.2\n", "bokeh 2.0.2\n", "bokeh_catplot 0.1.8\n", "jupyterlab 1.2.6\n" ] } ], "source": [ "%load_ext watermark\n", "%watermark -v -p numpy,pandas,bokeh,bokeh_catplot,jupyterlab" ] } ], "metadata": { "anaconda-cloud": {}, "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.7.7" } }, "nbformat": 4, "nbformat_minor": 4 }