{ "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\") || (!Object.prototype.hasOwnProperty.call(output.data, 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(\"1002\");\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(url) {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (let i = 0; i < css_urls.length; i++) {\n", " const url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error.bind(null, url);\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.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n", "\n", " for (let i = 0; i < js_urls.length; i++) {\n", " const url = js_urls[i];\n", " const element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error.bind(null, url);\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.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.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(\"1002\")).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(\"1002\");\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(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\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.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\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.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.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(\"1002\")).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 iqplot\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, we do some plotting with a high-level package [iqplot](https://iqplot.github.io/). 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 [iqplot](https://iqplot.github.io/).\n", "\n", "Why are we using this package and not HoloViews? iqplot 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 iqplot 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 = {\"f42f83d5-f626-4893-bb6a-cf2a988edb90\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1012\"}],\"center\":[{\"id\":\"1015\"},{\"id\":\"1018\"}],\"frame_height\":200,\"frame_width\":400,\"left\":[{\"id\":\"1016\"}],\"renderers\":[{\"id\":\"1032\"}],\"title\":{\"id\":\"1034\"},\"toolbar\":{\"id\":\"1023\"},\"x_range\":{\"id\":\"1004\"},\"x_scale\":{\"id\":\"1008\"},\"y_range\":{\"id\":\"1006\"},\"y_scale\":{\"id\":\"1010\"}},\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1028\"},\"glyph\":{\"id\":\"1030\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1031\"},\"view\":{\"id\":\"1033\"}},\"id\":\"1032\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1021\"},{\"id\":\"1022\"}]},\"id\":\"1023\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1038\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1037\",\"type\":\"AllLabels\"},{\"attributes\":{\"source\":{\"id\":\"1028\"}},\"id\":\"1033\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.6},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"ID\"}},\"id\":\"1030\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1042\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1040\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1034\",\"type\":\"Title\"},{\"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\":\"1031\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1043\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1041\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"II\",\"III\",\"IV\"],\"impact force (mN)\":{\"__ndarray__\":\"zczMzMzol0DNzMzMzBqGQM3MzMzMMIFAmpmZmZkxekA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[4]},\"index\":[0,1,2,3]},\"selected\":{\"id\":\"1043\"},\"selection_policy\":{\"id\":\"1042\"}},\"id\":\"1028\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1017\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1038\"},\"major_label_policy\":{\"id\":\"1037\"},\"ticker\":{\"id\":\"1013\"}},\"id\":\"1012\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"1041\"},\"major_label_policy\":{\"id\":\"1040\"},\"ticker\":{\"id\":\"1017\"}},\"id\":\"1016\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1013\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1008\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"1012\"},\"ticker\":null},\"id\":\"1015\",\"type\":\"Grid\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"1006\",\"type\":\"FactorRange\"},{\"attributes\":{\"start\":0},\"id\":\"1004\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"1016\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1018\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1010\",\"type\":\"CategoricalScale\"}],\"root_ids\":[\"1003\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"f42f83d5-f626-4893-bb6a-cf2a988edb90\",\"root_ids\":[\"1003\"],\"roots\":{\"1003\":\"d7b74d0e-e03f-47da-8a9f-fc63a1af695f\"}}];\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": "1003" } }, "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 = {\"1cbe40e0-311e-4132-ac06-c3ebc55df04e\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1103\"}],\"center\":[{\"id\":\"1105\"},{\"id\":\"1109\"}],\"frame_height\":250,\"frame_width\":250,\"left\":[{\"id\":\"1106\"}],\"renderers\":[{\"id\":\"1128\"}],\"title\":{\"id\":\"1140\"},\"toolbar\":{\"id\":\"1117\"},\"x_range\":{\"id\":\"1095\"},\"x_scale\":{\"id\":\"1099\"},\"y_range\":{\"id\":\"1097\"},\"y_scale\":{\"id\":\"1101\"}},\"id\":\"1094\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1111\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1149\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1101\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1147\"},\"major_label_policy\":{\"id\":\"1146\"},\"ticker\":{\"id\":\"1107\"}},\"id\":\"1106\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1099\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1144\"},\"major_label_policy\":{\"id\":\"1143\"},\"ticker\":{\"id\":\"1104\"}},\"id\":\"1103\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1143\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1104\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1103\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"1105\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1148\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"1106\"},\"dimension\":1,\"ticker\":null},\"id\":\"1109\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1144\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1107\",\"type\":\"BasicTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1110\"},{\"id\":\"1111\"},{\"id\":\"1112\"},{\"id\":\"1113\"},{\"id\":\"1114\"},{\"id\":\"1115\"}]},\"id\":\"1117\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1115\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1110\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1116\"}},\"id\":\"1112\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1113\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1114\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"impact force (mN)\"},\"width\":{\"value\":0.6},\"x\":{\"field\":\"ID\"}},\"id\":\"1126\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"1146\",\"type\":\"AllLabels\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"1095\",\"type\":\"FactorRange\"},{\"attributes\":{\"source\":{\"id\":\"1124\"}},\"id\":\"1129\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1147\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"II\",\"III\",\"IV\"],\"impact force (mN)\":{\"__ndarray__\":\"zczMzMzol0DNzMzMzBqGQM3MzMzMMIFAmpmZmZkxekA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[4]},\"index\":[0,1,2,3]},\"selected\":{\"id\":\"1149\"},\"selection_policy\":{\"id\":\"1148\"}},\"id\":\"1124\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1140\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1116\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"1124\"},\"glyph\":{\"id\":\"1126\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1127\"},\"view\":{\"id\":\"1129\"}},\"id\":\"1128\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"start\":0},\"id\":\"1097\",\"type\":\"DataRange1d\"},{\"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\":\"1127\",\"type\":\"VBar\"}],\"root_ids\":[\"1094\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"1cbe40e0-311e-4132-ac06-c3ebc55df04e\",\"root_ids\":[\"1094\"],\"roots\":{\"1094\":\"8fb1dcba-cdfd-4f49-b871-6f7f5eb160a2\"}}];\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": "1094" } }, "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": [ "## iqplot\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 iqplot as our high-level package for making plots for now.\n", "\n", "iqplot 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 six (really four) types of plots that iqplot 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: `iqplot.box()`\n", " + Strip plots: `iqplot.strip()`\n", " + Strip-box plots `iqplot.stripbox()`, which is an overlay of a strip and box plot\n", " + Parallel coordinate plots `iqplot.strip()` with a `parcoord_column` kwarg. This is a strip plot with the dots connected across categories.\n", " \n", " \n", "- **Plots without a categorical axis**\n", " + Histograms: `iqplot.histogram()`\n", " + [ECDFs](https://en.wikipedia.org/wiki/Empirical_distribution_function): `iqplot.ecdf()`\n", " \n", "\n", "This first seven arguments are the same for all plots. They are:\n", "\n", "- `data`: A tidy data frame or Numpy array.\n", "- `q`: The column of the data frame to be treated as the quantitative variable.\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", "- `q_axis`: Along which axis, x or y that the quantitative variable varies. The default is `'x'`.\n", "- `palette`: A list of hex colors to use for coloring the markers for each category. By default, it uses the Glasbey Category 10 color palette from [colorcet](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", "With this in mind, we will put iqplot to use on the frog data set." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Box plots with iqplot\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 `iqplot.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 = {\"18a7167f-ff28-498d-8e01-3e486c79383c\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1215\"}],\"center\":[{\"id\":\"1218\"},{\"id\":\"1221\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1219\"}],\"renderers\":[{\"id\":\"1244\"},{\"id\":\"1249\"},{\"id\":\"1254\"},{\"id\":\"1259\"},{\"id\":\"1264\"}],\"title\":{\"id\":\"1287\"},\"toolbar\":{\"id\":\"1229\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"1208\"},\"x_scale\":{\"id\":\"1211\"},\"y_range\":{\"id\":\"1206\"},\"y_scale\":{\"id\":\"1213\"}},\"id\":\"1207\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1287\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1238\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1239\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1262\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1213\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1238\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1239\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1263\",\"type\":\"Circle\"},{\"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\":\"1238\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1248\",\"type\":\"Segment\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1243\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1216\",\"type\":\"BasicTicker\"},{\"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\":\"1240\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data_source\":{\"id\":\"1236\"},\"glyph\":{\"id\":\"1247\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1248\"},\"view\":{\"id\":\"1250\"}},\"id\":\"1249\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1236\"},\"glyph\":{\"id\":\"1252\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1253\"},\"view\":{\"id\":\"1255\"}},\"id\":\"1254\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1222\"},{\"id\":\"1223\"},{\"id\":\"1224\"},{\"id\":\"1225\"},{\"id\":\"1226\"},{\"id\":\"1227\"}]},\"id\":\"1229\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"1236\"},\"glyph\":{\"id\":\"1257\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1258\"},\"view\":{\"id\":\"1260\"}},\"id\":\"1259\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1291\"},\"major_label_policy\":{\"id\":\"1290\"},\"ticker\":{\"id\":\"1216\"}},\"id\":\"1215\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1227\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis\":{\"id\":\"1215\"},\"ticker\":null},\"id\":\"1218\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1296\",\"type\":\"Selection\"},{\"attributes\":{\"overlay\":{\"id\":\"1228\"}},\"id\":\"1224\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1257\",\"type\":\"HBar\"},{\"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\":\"1296\"},\"selection_policy\":{\"id\":\"1295\"}},\"id\":\"1236\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1297\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1222\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1225\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1240\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1252\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1226\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"1219\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1221\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1294\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1290\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1220\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"1236\"},\"glyph\":{\"id\":\"1242\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1243\"},\"view\":{\"id\":\"1245\"}},\"id\":\"1244\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"1298\"},\"selection_policy\":{\"id\":\"1297\"}},\"id\":\"1237\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1237\"},\"glyph\":{\"id\":\"1262\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1263\"},\"view\":{\"id\":\"1265\"}},\"id\":\"1264\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1242\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1208\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1237\"}},\"id\":\"1265\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1228\",\"type\":\"BoxAnnotation\"},{\"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\":\"1239\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"1293\",\"type\":\"AllLabels\"},{\"attributes\":{\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1247\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"1236\"}},\"id\":\"1255\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1211\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1236\"}},\"id\":\"1245\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1240\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1253\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"1236\"}},\"id\":\"1250\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1236\"}},\"id\":\"1260\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1223\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1294\"},\"major_label_policy\":{\"id\":\"1293\"},\"ticker\":{\"id\":\"1220\"}},\"id\":\"1219\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"1206\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1291\",\"type\":\"BasicTickFormatter\"},{\"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\":\"1258\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1295\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1298\",\"type\":\"Selection\"}],\"root_ids\":[\"1207\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"18a7167f-ff28-498d-8e01-3e486c79383c\",\"root_ids\":[\"1207\"],\"roots\":{\"1207\":\"a86153d3-3ac6-4ba5-99d5-7ffd3087826f\"}}];\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": "1207" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.box(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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 = {\"f37ac650-67d0-4443-aeec-8e754d649160\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1374\"}],\"center\":[{\"id\":\"1377\"},{\"id\":\"1380\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1378\"}],\"renderers\":[{\"id\":\"1400\"}],\"title\":{\"id\":\"1436\"},\"toolbar\":{\"id\":\"1388\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"1367\"},\"x_scale\":{\"id\":\"1370\"},\"y_range\":{\"id\":\"1365\"},\"y_scale\":{\"id\":\"1372\"}},\"id\":\"1366\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1442\",\"type\":\"AllLabels\"},{\"attributes\":{\"source\":{\"id\":\"1396\"}},\"id\":\"1401\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1443\",\"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\":\"1395\",\"type\":\"CategoricalColorMapper\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1387\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1444\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1436\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1367\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"1396\"},\"glyph\":{\"id\":\"1398\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1399\"},\"view\":{\"id\":\"1401\"}},\"id\":\"1400\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1445\",\"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\",\"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\":\"1445\"},\"selection_policy\":{\"id\":\"1444\"}},\"id\":\"1396\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1375\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1370\",\"type\":\"LinearScale\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"1365\",\"type\":\"FactorRange\"},{\"attributes\":{\"axis\":{\"id\":\"1374\"},\"ticker\":null},\"id\":\"1377\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1440\"},\"major_label_policy\":{\"id\":\"1439\"},\"ticker\":{\"id\":\"1375\"}},\"id\":\"1374\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1372\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1386\",\"type\":\"HelpTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1443\"},\"major_label_policy\":{\"id\":\"1442\"},\"ticker\":{\"id\":\"1379\"}},\"id\":\"1378\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1378\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1380\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1379\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1381\"},{\"id\":\"1382\"},{\"id\":\"1383\"},{\"id\":\"1384\"},{\"id\":\"1385\"},{\"id\":\"1386\"}]},\"id\":\"1388\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1382\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1381\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1387\"}},\"id\":\"1383\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1384\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1395\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1395\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1399\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1385\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1395\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1395\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1398\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1439\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1440\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"1366\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"f37ac650-67d0-4443-aeec-8e754d649160\",\"root_ids\":[\"1366\"],\"roots\":{\"1366\":\"426b9493-b08b-48ce-9d9c-8251f43d26fc\"}}];\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": "1366" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": [ "## Strip-box plots\n", "\n", "It is sometimes useful to overlay strip plots with box plots, as the box plots show useful quantile information. This is accomplished using the `iqplot.stripbox()` 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 = {\"3ca5cb45-d466-4ebc-8296-62c60c4a8b66\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1511\"}],\"center\":[{\"id\":\"1514\"},{\"id\":\"1517\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1515\"}],\"renderers\":[{\"id\":\"1540\"},{\"id\":\"1545\"},{\"id\":\"1550\"},{\"id\":\"1555\"},{\"id\":\"1560\"},{\"id\":\"1565\"},{\"id\":\"1573\"}],\"title\":{\"id\":\"1620\"},\"toolbar\":{\"id\":\"1525\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"1504\"},\"x_scale\":{\"id\":\"1507\"},\"y_range\":{\"id\":\"1502\"},\"y_scale\":{\"id\":\"1509\"}},\"id\":\"1503\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1563\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1564\"},\"view\":{\"id\":\"1566\"}},\"id\":\"1565\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1623\",\"type\":\"AllLabels\"},{\"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\":\"1631\"},\"selection_policy\":{\"id\":\"1630\"}},\"id\":\"1569\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1512\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1568\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1568\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1572\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1507\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1563\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1566\",\"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\":\"1568\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis\":{\"id\":\"1511\"},\"ticker\":null},\"id\":\"1514\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1568\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1568\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1571\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1509\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1624\"},\"major_label_policy\":{\"id\":\"1623\"},\"ticker\":{\"id\":\"1512\"}},\"id\":\"1511\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1624\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1536\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1559\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"1569\"}},\"id\":\"1574\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1523\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1569\"},\"glyph\":{\"id\":\"1571\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1572\"},\"view\":{\"id\":\"1574\"}},\"id\":\"1573\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1518\"},{\"id\":\"1519\"},{\"id\":\"1520\"},{\"id\":\"1521\"},{\"id\":\"1522\"},{\"id\":\"1523\"}]},\"id\":\"1525\",\"type\":\"Toolbar\"},{\"attributes\":{\"formatter\":{\"id\":\"1627\"},\"major_label_policy\":{\"id\":\"1626\"},\"ticker\":{\"id\":\"1516\"}},\"id\":\"1515\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1515\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1517\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1516\",\"type\":\"CategoricalTicker\"},{\"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\":\"1629\"},\"selection_policy\":{\"id\":\"1628\"}},\"id\":\"1532\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1627\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1628\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1519\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1626\",\"type\":\"AllLabels\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1553\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1554\"},\"view\":{\"id\":\"1556\"}},\"id\":\"1555\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1518\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1524\"}},\"id\":\"1520\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1561\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1629\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1521\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1522\",\"type\":\"ResetTool\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1541\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1556\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"1502\",\"type\":\"FactorRange\"},{\"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\":\"1549\",\"type\":\"HBar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1544\",\"type\":\"Segment\"},{\"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\":\"1554\",\"type\":\"HBar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1539\",\"type\":\"Segment\"},{\"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\":\"1548\",\"type\":\"HBar\"},{\"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\":\"1553\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1630\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1538\",\"type\":\"Segment\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1538\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1539\"},\"view\":{\"id\":\"1541\"}},\"id\":\"1540\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1558\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1559\"},\"view\":{\"id\":\"1561\"}},\"id\":\"1560\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1548\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1549\"},\"view\":{\"id\":\"1551\"}},\"id\":\"1550\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1631\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1532\"},\"glyph\":{\"id\":\"1543\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1544\"},\"view\":{\"id\":\"1546\"}},\"id\":\"1545\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1620\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1551\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1524\",\"type\":\"BoxAnnotation\"},{\"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\":\"1564\",\"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\":\"1536\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"fill_alpha\":{\"value\":0},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1536\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1558\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1504\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1543\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"1532\"}},\"id\":\"1546\",\"type\":\"CDSView\"}],\"root_ids\":[\"1503\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"3ca5cb45-d466-4ebc-8296-62c60c4a8b66\",\"root_ids\":[\"1503\"],\"roots\":{\"1503\":\"fd01eab9-a42e-4ce1-8f57-f64edd861475\"}}];\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": "1503" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.stripbox(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "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": 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 = {\"1c06ef10-0162-47be-a5ca-6ea7e17f33d6\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1707\"}],\"center\":[{\"id\":\"1710\"},{\"id\":\"1714\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1711\"}],\"renderers\":[{\"id\":\"1732\"},{\"id\":\"1737\"},{\"id\":\"1742\"},{\"id\":\"1747\"},{\"id\":\"1752\"},{\"id\":\"1757\"},{\"id\":\"1762\"},{\"id\":\"1767\"},{\"id\":\"1772\"},{\"id\":\"1777\"},{\"id\":\"1782\"},{\"id\":\"1787\"}],\"right\":[{\"id\":\"1789\"}],\"title\":{\"id\":\"1852\"},\"toolbar\":{\"id\":\"1722\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"1700\"},\"x_scale\":{\"id\":\"1703\"},\"y_range\":{\"id\":\"1698\"},\"y_scale\":{\"id\":\"1705\"}},\"id\":\"1699\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1721\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1872\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1873\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"1732\"},{\"id\":\"1737\"}]},\"id\":\"1790\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"1774\"}},\"id\":\"1778\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1739\"}},\"id\":\"1743\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1874\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#2ba02b\",\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1756\",\"type\":\"Patch\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"1742\"},{\"id\":\"1747\"}]},\"id\":\"1791\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1852\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1875\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQDMzMzMzM4BAMzMzMzMzgEBmZmZmZr6IQGZmZmZmvohAzMzMzMykkEDMzMzMzKSQQGZmZmZm6pRAZmZmZmbqlEAAAAAAADCZQAAAAAAAMJlAAAAAAAAwmUAAAAAAAKBuQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAgQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAcQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAACEAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]}},\"selected\":{\"id\":\"1867\"},\"selection_policy\":{\"id\":\"1866\"}},\"id\":\"1744\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"1752\"},{\"id\":\"1757\"}]},\"id\":\"1792\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1745\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1729\"},\"glyph\":{\"id\":\"1730\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1731\"},\"view\":{\"id\":\"1733\"}},\"id\":\"1732\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1741\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1740\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"xs\":[[1205,1205],[2527,2527],[1745,1745],[1556,1556],[493,493],[2276,2276],[556,556],[1928,1928],[2641,2641],[1897,1897],[1891,1891],[1545,1545],[1307,1307],[1692,1692],[1543,1543],[1282,1282],[775,775],[2032,2032],[1240,1240],[473,473]],\"ys\":[[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4]]},\"selected\":{\"id\":\"1877\"},\"selection_policy\":{\"id\":\"1876\"}},\"id\":\"1769\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QFVVVVVV5XFAVVVVVVXlcUBVVVVVVTWBQFVVVVVVNYFAAAAAAAB4iUAAAAAAAHiJQAAAAAAAeIlAAAAAAAAANkA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAcQAAAAAAAABxAAAAAAAAAGEAAAAAAAAAYQAAAAAAAABxAAAAAAAAAHEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]}},\"selected\":{\"id\":\"1875\"},\"selection_policy\":{\"id\":\"1874\"}},\"id\":\"1764\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1770\",\"type\":\"MultiLine\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QM3MzMzMVIxAzczMzMxUjEDNzMzMzPCUQM3MzMzM8JRANDMzMzO3m0A0MzMzM7ebQM3MzMzMPqFAzczMzMw+oUAAAAAAAKKkQAAAAAAAoqRA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"1861\"},\"selection_policy\":{\"id\":\"1860\"}},\"id\":\"1729\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1730\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1876\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"1754\"}},\"id\":\"1758\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1877\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1729\"}},\"id\":\"1733\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1731\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1749\"}},\"id\":\"1753\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1735\",\"type\":\"Patch\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QM3MzMzMVIxAzczMzMxUjEDNzMzMzPCUQM3MzMzM8JRANDMzMzO3m0A0MzMzM7ebQM3MzMzMPqFAzczMzMw+oUAAAAAAAKKkQAAAAAAAoqRAAAAAAACipEAAAAAAAJB9QA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]}},\"selected\":{\"id\":\"1863\"},\"selection_policy\":{\"id\":\"1862\"}},\"id\":\"1734\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1736\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1734\"},\"glyph\":{\"id\":\"1735\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1736\"},\"view\":{\"id\":\"1738\"}},\"id\":\"1737\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1734\"}},\"id\":\"1738\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1754\"},\"glyph\":{\"id\":\"1755\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1756\"},\"view\":{\"id\":\"1758\"}},\"id\":\"1757\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1764\"}},\"id\":\"1768\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1878\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1765\",\"type\":\"Patch\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#d62628\",\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1766\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1879\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1784\"}},\"id\":\"1788\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1746\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"1769\"}},\"id\":\"1773\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1744\"},\"glyph\":{\"id\":\"1745\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1746\"},\"view\":{\"id\":\"1748\"}},\"id\":\"1747\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1774\"},\"glyph\":{\"id\":\"1775\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1776\"},\"view\":{\"id\":\"1778\"}},\"id\":\"1777\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1771\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"1764\"},\"glyph\":{\"id\":\"1765\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1766\"},\"view\":{\"id\":\"1768\"}},\"id\":\"1767\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"1762\"},{\"id\":\"1767\"}]},\"id\":\"1793\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"xs\":[[1612,1612],[605,605],[327,327],[946,946],[541,541],[1539,1539],[529,529],[628,628],[1453,1453],[297,297],[703,703],[269,269],[751,751],[245,245],[1182,1182],[515,515],[435,435],[383,383],[457,457],[730,730]],\"ys\":[[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4]]},\"selected\":{\"id\":\"1879\"},\"selection_policy\":{\"id\":\"1878\"}},\"id\":\"1774\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1880\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1775\",\"type\":\"MultiLine\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1780\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"1881\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1779\"},\"glyph\":{\"id\":\"1780\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1781\"},\"view\":{\"id\":\"1783\"}},\"id\":\"1782\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"xs\":[[614,614],[414,414],[324,324],[776,776],[611,611],[544,544],[538,538],[579,579],[806,806],[459,459],[458,458],[626,626],[621,621],[544,544],[535,535],[385,385],[401,401],[614,614],[665,665],[488,488]],\"ys\":[[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4]]},\"selected\":{\"id\":\"1881\"},\"selection_policy\":{\"id\":\"1880\"}},\"id\":\"1779\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1779\"}},\"id\":\"1783\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1776\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"1739\"},\"glyph\":{\"id\":\"1740\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1741\"},\"view\":{\"id\":\"1743\"}},\"id\":\"1742\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1785\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"1784\"},\"glyph\":{\"id\":\"1785\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1786\"},\"view\":{\"id\":\"1788\"}},\"id\":\"1787\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1751\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"xs\":[[172,172],[142,142],[37,37],[453,453],[355,355],[22,22],[502,502],[273,273],[720,720],[582,582],[198,198],[198,198],[597,597],[516,516],[815,815],[402,402],[605,605],[711,711],[614,614],[468,468]],\"ys\":[[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4],[0,0.4]]},\"selected\":{\"id\":\"1883\"},\"selection_policy\":{\"id\":\"1882\"}},\"id\":\"1784\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1855\",\"type\":\"AllLabels\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1781\",\"type\":\"MultiLine\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1786\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"1882\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1856\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1883\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1858\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1860\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1859\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1861\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1862\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1864\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1863\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1865\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1866\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1856\"},\"major_label_policy\":{\"id\":\"1855\"},\"ticker\":{\"id\":\"1708\"}},\"id\":\"1707\",\"type\":\"LinearAxis\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1790\"},{\"id\":\"1791\"},{\"id\":\"1792\"},{\"id\":\"1793\"}],\"location\":\"center\"},\"id\":\"1789\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"1867\",\"type\":\"Selection\"},{\"attributes\":{\"start\":0},\"id\":\"1698\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1700\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQDMzMzMzM4BAMzMzMzMzgEBmZmZmZr6IQGZmZmZmvohAzMzMzMykkEDMzMzMzKSQQGZmZmZm6pRAZmZmZmbqlEAAAAAAADCZQAAAAAAAMJlA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAgQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAcQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAACEAAAAAAAAAIQAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"1865\"},\"selection_policy\":{\"id\":\"1864\"}},\"id\":\"1739\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1708\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1718\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1703\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"1707\"},\"ticker\":null},\"id\":\"1710\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1705\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QGZmZmZmRnpAZmZmZmZGekBmZmZmZiaAQGZmZmZmJoBAmpmZmZkpg0CamZmZmSmDQM3MzMzMLIZAzczMzMwshkAAAAAAADCJQAAAAAAAMIlAAAAAAAAwiUAAAAAAAEB0QA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAUQAAAAAAAABRAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]}},\"selected\":{\"id\":\"1871\"},\"selection_policy\":{\"id\":\"1870\"}},\"id\":\"1754\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1868\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1716\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"1859\"},\"major_label_policy\":{\"id\":\"1858\"},\"ticker\":{\"id\":\"1712\"}},\"id\":\"1711\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1711\"},\"dimension\":1,\"ticker\":null},\"id\":\"1714\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1869\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1712\",\"type\":\"BasicTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1715\"},{\"id\":\"1716\"},{\"id\":\"1717\"},{\"id\":\"1718\"},{\"id\":\"1719\"},{\"id\":\"1720\"}]},\"id\":\"1722\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1720\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1715\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1721\"}},\"id\":\"1717\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1719\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1761\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QFVVVVVV5XFAVVVVVVXlcUBVVVVVVTWBQFVVVVVVNYFAAAAAAAB4iUAAAAAAAHiJQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAcQAAAAAAAABxAAAAAAAAAGEAAAAAAAAAYQAAAAAAAABxAAAAAAAAAHEAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]}},\"selected\":{\"id\":\"1873\"},\"selection_policy\":{\"id\":\"1872\"}},\"id\":\"1759\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1755\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1870\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1769\"},\"glyph\":{\"id\":\"1770\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1771\"},\"view\":{\"id\":\"1773\"}},\"id\":\"1772\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1759\"}},\"id\":\"1763\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1749\"},\"glyph\":{\"id\":\"1750\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1751\"},\"view\":{\"id\":\"1753\"}},\"id\":\"1752\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1759\"},\"glyph\":{\"id\":\"1760\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1761\"},\"view\":{\"id\":\"1763\"}},\"id\":\"1762\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1871\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1744\"}},\"id\":\"1748\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1760\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QGZmZmZmRnpAZmZmZmZGekBmZmZmZiaAQGZmZmZmJoBAmpmZmZkpg0CamZmZmSmDQM3MzMzMLIZAzczMzMwshkAAAAAAADCJQAAAAAAAMIlA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAQQAAAAAAAABBAAAAAAAAACEAAAAAAAAAIQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAUQAAAAAAAABRAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"1869\"},\"selection_policy\":{\"id\":\"1868\"}},\"id\":\"1749\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1750\",\"type\":\"Line\"}],\"root_ids\":[\"1699\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"1c06ef10-0162-47be-a5ca-6ea7e17f33d6\",\"root_ids\":[\"1699\"],\"roots\":{\"1699\":\"b3b7677c-b99c-4f08-bafb-5f15a756d701\"}}];\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": "1699" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.histogram(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that by default, iqplot includes a **rug plot** at the bottom of the histogram, showing each measurement." ] }, { "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 now, this is for purposes of discussing plotting options.)\n", "\n", "Note that iqplot can take a Numpy array as the `data` argument, and makes a plot assuming it contains a single data set." ] }, { "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 = {\"e130c250-4024-4a79-a96b-583f3bcb9066\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2059\"}],\"center\":[{\"id\":\"2062\"},{\"id\":\"2066\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2063\"}],\"renderers\":[{\"id\":\"2084\"},{\"id\":\"2089\"}],\"title\":{\"id\":\"2182\"},\"toolbar\":{\"id\":\"2074\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"2052\"},\"x_scale\":{\"id\":\"2055\"},\"y_range\":{\"id\":\"2050\"},\"y_scale\":{\"id\":\"2057\"}},\"id\":\"2051\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2189\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2190\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"start\":0},\"id\":\"2050\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"4D20Y8ElDcDgPbRjwSUNwDWMimLVxArANYyKYtXECsCL2mBh6WMIwIvaYGHpYwjA4Cg3YP0CBsDgKDdg/QIGwDZ3DV8RogPANncNXxGiA8CLxeNdJUEBwIvF410lQQHAwCd0uXLA/b/AJ3S5csD9v2zEILea/vi/bMQgt5r++L8WYc20wjz0vxZhzbTCPPS/gPvzZNX17r+A+/Nk1fXuv9g0TWAlcuW/2DRNYCVy5b9Y3Ey36tzXv1jcTLfq3Ne/ADz9typWs78APP23Klazv6B8nLaqY8w/oHyctqpjzD/Q5U2ympzgP9DlTbKanOA/gKz0tkog6j+ArPS2SiDqP5S5zV390fE/lLnNXf3R8T/oHCFg1ZP2P+gcIWDVk/Y/QIB0Yq1V+z9AgHRirVX7P8rxY7LCCwBAyvFjssILAEB0o42zrmwCQHSjjbOubAJAIFW3tJrNBEAgVbe0ms0EQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAhAAAAAAAAACEAAAAAAAAAuQAAAAAAAAC5AAAAAAAAALkAAAAAAAAAuQAAAAAAAAEFAAAAAAAAAQUAAAAAAAABAQAAAAAAAAEBAAAAAAAAASkAAAAAAAABKQAAAAAAAQFFAAAAAAABAUUAAAAAAAEBQQAAAAAAAQFBAAAAAAACAT0AAAAAAAIBPQAAAAAAAAEtAAAAAAAAAS0AAAAAAAABBQAAAAAAAAEFAAAAAAAAAN0AAAAAAAAA3QAAAAAAAACZAAAAAAAAAJkAAAAAAAAAiQAAAAAAAACJAAAAAAAAAIEAAAAAAAAAgQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]}},\"selected\":{\"id\":\"2191\"},\"selection_policy\":{\"id\":\"2190\"}},\"id\":\"2081\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2191\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2081\"},\"glyph\":{\"id\":\"2082\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2083\"},\"view\":{\"id\":\"2085\"}},\"id\":\"2084\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2082\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2073\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"2081\"}},\"id\":\"2085\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2185\",\"type\":\"AllLabels\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2083\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2192\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2087\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"2186\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"4D20Y8ElDcDgPbRjwSUNwDWMimLVxArANYyKYtXECsCL2mBh6WMIwIvaYGHpYwjA4Cg3YP0CBsDgKDdg/QIGwDZ3DV8RogPANncNXxGiA8CLxeNdJUEBwIvF410lQQHAwCd0uXLA/b/AJ3S5csD9v2zEILea/vi/bMQgt5r++L8WYc20wjz0vxZhzbTCPPS/gPvzZNX17r+A+/Nk1fXuv9g0TWAlcuW/2DRNYCVy5b9Y3Ey36tzXv1jcTLfq3Ne/ADz9typWs78APP23Klazv6B8nLaqY8w/oHyctqpjzD/Q5U2ympzgP9DlTbKanOA/gKz0tkog6j+ArPS2SiDqP5S5zV390fE/lLnNXf3R8T/oHCFg1ZP2P+gcIWDVk/Y/QIB0Yq1V+z9AgHRirVX7P8rxY7LCCwBAyvFjssILAEB0o42zrmwCQHSjjbOubAJAIFW3tJrNBEAgVbe0ms0EQCBVt7SazQRA4D20Y8ElDcA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[46]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAhAAAAAAAAACEAAAAAAAAAuQAAAAAAAAC5AAAAAAAAALkAAAAAAAAAuQAAAAAAAAEFAAAAAAAAAQUAAAAAAAABAQAAAAAAAAEBAAAAAAAAASkAAAAAAAABKQAAAAAAAQFFAAAAAAABAUUAAAAAAAEBQQAAAAAAAQFBAAAAAAACAT0AAAAAAAIBPQAAAAAAAAEtAAAAAAAAAS0AAAAAAAABBQAAAAAAAAEFAAAAAAAAAN0AAAAAAAAA3QAAAAAAAACZAAAAAAAAAJkAAAAAAAAAiQAAAAAAAACJAAAAAAAAAIEAAAAAAAAAgQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[46]}},\"selected\":{\"id\":\"2193\"},\"selection_policy\":{\"id\":\"2192\"}},\"id\":\"2086\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis\":{\"id\":\"2063\"},\"dimension\":1,\"ticker\":null},\"id\":\"2066\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2088\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"2193\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2052\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"2073\"}},\"id\":\"2069\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2086\"},\"glyph\":{\"id\":\"2087\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2088\"},\"view\":{\"id\":\"2090\"}},\"id\":\"2089\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2070\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2068\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2182\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2067\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2071\",\"type\":\"ResetTool\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2067\"},{\"id\":\"2068\"},{\"id\":\"2069\"},{\"id\":\"2070\"},{\"id\":\"2071\"},{\"id\":\"2072\"}]},\"id\":\"2074\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"2189\"},\"major_label_policy\":{\"id\":\"2188\"},\"ticker\":{\"id\":\"2064\"}},\"id\":\"2063\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2060\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"2086\"}},\"id\":\"2090\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2055\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2188\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"2059\"},\"ticker\":null},\"id\":\"2062\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2057\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2072\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"2186\"},\"major_label_policy\":{\"id\":\"2185\"},\"ticker\":{\"id\":\"2060\"}},\"id\":\"2059\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2064\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"2051\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"e130c250-4024-4a79-a96b-583f3bcb9066\",\"root_ids\":[\"2051\"],\"roots\":{\"2051\":\"0d2f7afb-fb12-47e7-83da-237028ee26db\"}}];\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": "2051" } }, "output_type": "display_data" } ], "source": [ "# Generate normally distributed data\n", "rg = np.random.default_rng(3252)\n", "x = rg.normal(size=500)\n", "\n", "# Plot the histogram\n", "p = iqplot.histogram(x, rug=False)\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": 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 = {\"52b7d887-871a-485f-9025-5fccb9e6b95e\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2269\"}],\"center\":[{\"id\":\"2272\"},{\"id\":\"2276\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2273\"}],\"renderers\":[{\"id\":\"2295\"}],\"title\":{\"id\":\"2401\"},\"toolbar\":{\"id\":\"2284\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"2261\"},\"x_scale\":{\"id\":\"2265\"},\"y_range\":{\"id\":\"2263\"},\"y_scale\":{\"id\":\"2267\"}},\"id\":\"2260\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2267\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2263\",\"type\":\"DataRange1d\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2283\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2401\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"2405\"},\"major_label_policy\":{\"id\":\"2404\"},\"ticker\":{\"id\":\"2270\"}},\"id\":\"2269\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2261\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2408\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2407\",\"type\":\"AllLabels\"},{\"attributes\":{\"data_source\":{\"id\":\"2291\"},\"glyph\":{\"id\":\"2293\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2294\"},\"view\":{\"id\":\"2296\"}},\"id\":\"2295\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2270\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2274\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2405\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2282\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2277\"},{\"id\":\"2278\"},{\"id\":\"2279\"},{\"id\":\"2280\"},{\"id\":\"2281\"},{\"id\":\"2282\"}]},\"id\":\"2284\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2265\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"2273\"},\"dimension\":1,\"ticker\":null},\"id\":\"2276\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2277\",\"type\":\"PanTool\"},{\"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\":\"2294\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"2283\"}},\"id\":\"2279\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2280\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2409\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2281\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"2269\"},\"ticker\":null},\"id\":\"2272\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2408\"},\"major_label_policy\":{\"id\":\"2407\"},\"ticker\":{\"id\":\"2274\"}},\"id\":\"2273\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2410\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"8tJNYhBYyT/sUbgehevpP8UgsHJokeU/g8DKoUW2wz/ZzvdT46W7P05iEFg5tOA/cT0K16NwzT/pJjEIrBy6P3sUrkfheqQ/2c73U+Olyz8tsp3vp8bjP1K4HoXrUeA/exSuR+F6hD9U46WbxCDQP39qvHSTGOw/8tJNYhBY6T8xCKwcWmTLPxSuR+F6FO4/K4cW2c730z9qvHSTGATWP3Noke18P+U/O99PjZduoj9oke18PzXOPwRWDi2ynd8/MzMzMzMzwz+6SQwCK4e2P8P1KFyPwu0/ukkMAiuHpj/VeOkmMQjcPzvfT42XbpI/I9v5fmq87D9iEFg5tMjuPxSuR+F6FOY/aJHtfD817j9GtvP91HjZP9nO91PjpeM/qvHSTWIQuD9QjZduEoPoP8uhRbbz/eQ/arx0kxgExj9MN4lBYOXAPxKDwMqhRdY/GQRWDi2yrT8730+Nl27iP/YoXI/C9eA//tR46SYx6D/Jdr6fGi/dP/YoXI/C9eg/XI/C9Shc3z+amZmZmZmpP6JFtvP91OA/fT81XrpJ5D9xPQrXo3DlPyuHFtnO98M/O99PjZduwj+F61G4HoXbP2q8dJMYBO4/mG4Sg8DK0T85tMh2vp/KP+Olm8QgsMI/JQaBlUOL7D/D9Shcj8LFP/7UeOkmMdg//Knx0k1iYD+gGi/dJAbhPwwCK4cW2eY/d76fGi/d7D/sUbgeheuxP5zEILByaOk/RIts5/up6T/8qfHSTWKwPzm0yHa+n6o/okW28/3U2D8pXI/C9SjkP1g5tMh2vu8/f2q8dJMY1D/RItv5fmrkP/yp8dJNYtA/BoGVQ4ts1z/6fmq8dJOoP8/3U+Olm+Q/hetRuB6F6z8X2c73U+PVP6wcWmQ73+8/+n5qvHSTmD/ByqFFtvPdPzeJQWDl0Oo/Di2yne+n7j93vp8aL93UP7x0kxgEVuY/cT0K16Nw7T8/NV66SQziPxfZzvdT4+0/pHA9Ctej4D+BlUOLbOfrP4/C9Shcj9I/mpmZmZmZ4T956SYxCKy8P+f7qfHSTdI/TmIQWDm02D+6SQwCK4fuP/p+arx0k9g/CKwcWmQ75z8zMzMzMzPTP0oMAiuHFtk/Gy/dJAaB5T+R7Xw/NV7qP7pJDAIrh9Y/nu+nxks36T+28/3UeOnWP4ts5/up8eo/pHA9Ctej6D/Jdr6fGi+9Pxsv3SQGgcU/JQaBlUOL5D+Nl24Sg8DqP8uhRbbz/ew/eekmMQis5D+uR+F6FK7XP8HKoUW2880/exSuR+F61D8ZBFYOLbLdPy2yne+nxus/001iEFg55D/pJjEIrBzqPzm0yHa+n+o/uB6F61G4vj+q8dJNYhDgP+XQItv5fuI/tMh2vp8a3z9iEFg5tMjGPzEIrBxaZOs/WDm0yHa+vz8dWmQ730/tPxkEVg4tsr0/aJHtfD813j/b+X5qvHTjP5ZDi2zn++E/O99PjZdu6j8EVg4tsp3nP9NNYhBYOdQ/+n5qvHSTeD956SYxCKycPyuHFtnO9+s/30+Nl24S6z9CYOXQItvhP/yp8dJNYug/0SLb+X5q3D9eukkMAivXPzeJQWDl0OI/4XoUrkfhyj8j2/l+arzkP0Jg5dAi2+k/PQrXo3A94j+oxks3iUHQP4GVQ4ts59s/XrpJDAIr5z8lBoGVQ4vcP1pkO99Pjac//Knx0k1icD9/arx0kxjkP0SLbOf7qdE/nMQgsHJowT+uR+F6FK7vP6AaL90kBuk/ObTIdr6fmj9I4XoUrkfhP5qZmZmZmek/SgwCK4cW6T8/NV66SQzqP1g5tMh2vuc/bxKDwMqh5T+yne+nxkvnPx1aZDvfT+U/nMQgsHJo4T8pXI/C9SjsP9nO91Pjpas/L90kBoGV4z9KDAIrhxbhP7pJDAIrh8Y/zczMzMzM7D+wcmiR7XzfP6JFtvP91Mg/mpmZmZmZuT+6SQwCK4fmP6abxCCwcuA/2/l+arx0sz+cxCCwcmjRP3npJjEIrMw/GQRWDi2y5T+sHFpkO9/nPzMzMzMzM+s/d76fGi/d5D9YObTIdr7PP1g5tMh2vt8/4XoUrkfh2j+8dJMYBFbuP0a28/3UeOE/z/dT46Wb7D+0yHa+nxrvP8dLN4lBYNU/NV66SQwC2z+28/3UeOnuP9ejcD0K19M/AAAAAAAA8D+mm8QgsHLYP5huEoPAyuk/kxgEVg4t4j8CK4cW2c7nP166SQwCK+8/aJHtfD815j+HFtnO91PTP2q8dJMYBLY/9ihcj8L12D++nxov3STuP1pkO99Pjcc/g8DKoUW24z/6fmq8dJPIP+F6FK5H4eI/ZmZmZmZm1j+yne+nxkvHP1yPwvUoXO8/i2zn+6nx4j/ByqFFtvPtP2ZmZmZmZuY/ke18PzVe2j+4HoXrUbjmP4PAyqFFttM/eekmMQisjD9SuB6F61HoPy/dJAaBles/x0s3iUFg5T8X2c73U+PlPw4tsp3vp9Y/zczMzMzM3D+BlUOLbOfjP4GVQ4ts58s/Gy/dJAaB7T/pJjEIrBzaP/hT46WbxNA/AiuHFtnO7z97FK5H4XrsP28Sg8DKoe0/Di2yne+n5j+q8dJNYhDIP0w3iUFg5bA/pHA9Ctej0D9MN4lBYOXgPzVeukkMAus/WmQ730+Ntz+yne+nxkvvPwisHFpkO98//tR46SYx4D9OYhBYObToPycxCKwcWuQ/BoGVQ4ts7z/D9Shcj8LlP/T91HjpJtE/+n5qvHSTiD9g5dAi2/neP3npJjEIrNw/AiuHFtnO1z91kxgEVg7dP5MYBFYOLeo/8KfGSzeJ6T/l0CLb+X7aP0SLbOf7qeE/uB6F61G47j+HFtnO91PrP7gehetRuJ4/JzEIrBxa7D9WDi2yne/vP0SLbOf7qcE/46WbxCCw0j+0yHa+nxrnP4XrUbgeheM/jZduEoPA2j8pXI/C9SjcP9nO91Pjpds//Knx0k1iwD/RItv5fmrMPx+F61G4HtU/x0s3iUFg7T/ZzvdT46XrPzEIrBxaZOM/3SQGgZVD6z/8qfHSTWLgPwwCK4cW2e4//Knx0k1igD8xCKwcWmTbP0oMAiuHFsk/H4XrUbge7T97FK5H4XrEPwrXo3A9Ctc/5/up8dJN6j9oke18PzW+PxKDwMqhRcY/KVyPwvUozD/y0k1iEFjZPxKDwMqhReY/O99PjZdusj+sHFpkO9/fP23n+6nx0u0/Vg4tsp3v1z/P91PjpZvUP30/NV66Sdw/ukkMAiuHlj9SuB6F61HIP4lBYOXQIrs/VOOlm8Qg6D9MN4lBYOXoP0Jg5dAi29k/+n5qvHST4D9t5/up8dLdP5zEILByaKE/BFYOLbKd7z/RItv5fmrsP5HtfD81Xso/ZDvfT42X5j/dJAaBlUPbPyPb+X5qvNQ/c2iR7Xw/xT/Jdr6fGi/lPwrXo3A9Cuc/16NwPQrX4z+wcmiR7XznP1pkO99Pje8/EFg5tMh27j+wcmiR7XzvPwrXo3A9Crc/K4cW2c734z8hsHJoke3kP2Dl0CLb+eY/30+Nl24S0z8QWDm0yHbeP83MzMzMzOQ/hxbZzvdT4z/FILByaJHtPzm0yHa+n9o/lkOLbOf76T+4HoXrUbjePx1aZDvfT90/+FPjpZvE4D+8dJMYBFbePwaBlUOLbOc/vp8aL90k1j8j2/l+arzEP/hT46WbxOg/1XjpJjEI5D9GtvP91HjpP0Jg5dAi28k/9P3UeOkmwT91kxgEVg7lP5HtfD81XuI/2/l+arx0oz8AAAAAAADgP5MYBFYOLdI/2/l+arx00z956SYxCKzsP8UgsHJokd0/fT81XrpJ7D+JQWDl0CLjP1CNl24Sg+A/vp8aL90k5j8Sg8DKoUXuP5zEILByaLE/K4cW2c73sz/wp8ZLN4nRP/yp8dJNYpA/Gy/dJAaBpT9kO99PjZfeP7ByaJHtfM8/y6FFtvP9xD8QWDm0yHbmP6jGSzeJQeg/CKwcWmQ7zz8bL90kBoG1P1pkO99Pjec/N4lBYOXQ0j/sUbgehevhP+xRuB6F69E/eekmMQisrD+uR+F6FK7nP3WTGARWDu0/001iEFg57D/VeOkmMQjsP6AaL90kBtE/Vg4tsp3v5z+YbhKDwMrhPx+F61G4HuU/VOOlm8Qg4D/Xo3A9CtfrP/yp8dJNYqA/46WbxCCw6j/jpZvEILDiPz0K16NwPdo/GQRWDi2y7T9iEFg5tMjWP4PAyqFFtus/7nw/NV664T9KDAIrhxa5PwIrhxbZzsc/w/UoXI/C1T8730+Nl27SP4/C9Shcj+I/CtejcD0Kxz/fT42XbhLjPy2yne+nxts/MzMzMzMz4z/0/dR46SbhP5MYBFYOLcI/c2iR7Xw/1T9xPQrXo3DdP6RwPQrXo8A/FK5H4XoU3j/pJjEIrBzKP8uhRbbz/bQ/qvHSTWIQ6D8nMQisHFrUP3Noke18P+0/lkOLbOf72T9qvHSTGATmP4ts5/up8dI/exSuR+F65D9vEoPAyqHVP1CNl24Sg9A/ObTIdr6f4j9SuB6F61HYP1yPwvUoXOc/8tJNYhBY4T8hsHJoke3cP+xRuB6F68E/WDm0yHa+rz97FK5H4XqUP8l2vp8aL80/mpmZmZmZ2T+e76fGSzfZP0w3iUFg5dA/Gy/dJAaB1T+oxks3iUHgPwisHFpkO78/PQrXo3A96j/wp8ZLN4nhP7gehetRuM4/jZduEoPA4j9I4XoUrkfRP4ts5/up8bI/y6FFtvP91D9aZDvfT43XP90kBoGVQ+M/VOOlm8QgwD9kO99PjZfuP7bz/dR46eY/001iEFg5xD+amZmZmZnJP6abxCCwcug/YOXQItv57j9g5dAi2/nOP0jhehSuR+k/i2zn+6nxwj9iEFg5tMjmP/p+arx0k7g/AAAAAAAA0D8hsHJoke3MP7gehetRuK4/+n5qvHST6D97FK5H4Xq0P9v5fmq8dMM/NV66SQwC4z8/NV66SQzSP+58PzVeutk/iUFg5dAi2z+JQWDl0CLLP+XQItv5fuo/ObTIdr6fuj8AAAAAAADoPxkEVg4tss0/sp3vp8ZL1z/0/dR46SbpPy/dJAaBldM/DAIrhxbZ3j+e76fGSzfhP23n+6nx0uU/qvHSTWIQ2D9mZmZmZmbuP8HKoUW28+U/2/l+arx06z+PwvUoXI/qPwrXo3A9Cu8/CKwcWmQ77z+iRbbz/dToP+F6FK5H4eo/IbByaJHt7D8QWDm0yHbOP4lBYOXQIus/yXa+nxov7T8pXI/C9Si8P+kmMQisHOI/5/up8dJN4j/ufD81XrrpPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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__\":\"5w0fnPNA6L8xqyiMptjpP9WpfnIdwNs/k49p/3Rl7r+1XGgpAurxv8/3z3mSorA/rAIdeMeY479auYQZAk/yv9XgThZLXPu/puJ5CMo+5b+dlH0cZe/SP6u0t/KWZpQ//m5Ui1XSAsA0IlmVw47hv2c6JXL1+fA/KTb74slS6D+FMFl0kn7lv6ohdRlLFPc/4m8Gp0V62b9IarBlsdrVv6GcEPw8udo/wAAMfmaf+7/WeEDIqb3iv2gDeu/vlYi/Gi/Z1Whn779Mt5NuWejzv+Xt/vVz7PU/fOkasdhK+7/T3C1u2NjBv8tinb1AsQDAC52eWbOs8j9Twb34RUj8PzzefpRAi90/r9HLJ59Q9z/8n+bfS73LvxQ+7Nx0aNI/HYq/18GY878WS+IkqzzmP+2E+Lcwv9k/RpqsLHyT67/AJ0bCuObwv2uDB1rNBNW/zd0FSh2m9796/YLBglPHP1mv8td6/LU/5/PGlNni5D8qYFy+R0q1v7vAyIlVSOc/gli2hCo9jL+ylt4nmyL6v3aN6ZA4vrI/C49v+Lq71j8Xjes3VU7bPw6scky8Tu6/vjINnB5u8L+DZmwz0+zCvxb9rfiSEvc/PYtoGY7t37/CNxYno53mvxbiMHqdGfC/MPXV2Mnx8T+DVHjlUKfrvyofG+zjxtC/4D20Y8ElDcBt1DPoqNG2P/qeyOT/seA//SF/8C0g8z/hfb8XXE32v6J0v4Zyc+g/mmcyCPCV6T/XZG7Yrpf2v7Pd0/LaOvm/45SUqo+2zb+JokdKXlPUP7k07nUtHQNAl/5F0B/u2L8vANfN3gPXP0IUFE3aWOG/CfARHHae0r9ZBGJ+0kP6v7qRcSbvMtg/54L2u5lO7z8rgqSW3ADWvxCmxMf+XQRAnbtB3x6j/b8vwF7KWmupv+gWbsKJqew/oyCgWgPH+z+NrBcZhdnWvyiRdYuPgN4/GxKcdKsv9D8dutvXAIDEP7UnkDWaEPY/zD8o+7AqsD/BQG31jZTwPy7mKZyCfd2/us3t47jDvz+6f9wNjdHxv8s5gZ0rV9+/AaMO+1P1zb8Jnw+/YJP6P+agVROGo86/VJy0SfE14j9RIkubSOXavxoaDmk1+8y/bNxNvR+92z99hLAXTYfqP4fo9cMUh9S/WxF8XSXk5z/g663bOP/Tv5+86O3HwOw/KIxV4fO95j8mqzQzXprxv2Zg2Ztmjuy/YsXJHlzl1z+GaMMREGfsP5KaJN/XNfM/inGU8nNU2D/fQvYKM/PRv2LTr7WYcuO/2WzzyiyB17/V0PuqJ1ytv1ZOah8N8+8/dCVQbKb41T9fFj+4APbpPwayaONlOes/lyRarZZq8b8t06br3xp+PyhVrNraqMo/DTotiWDjmL/NE6L51fnqv/ae0eoQxO4/qxuF0tlf8b8LjgPC09fzP7BbmIibjfG/fP3Te76Epb9ioh6l4rzRP3cCLNnIXMQ/P0rUdBDI6j8eQXD1O5TjP47jnJLQYdi/gqf8k6TLA8Aic51h2Q39v3cBTfZHvvA/fVB3UMWa7T8nxR+G71vCPzrKg5oYxeU/WI1O9mWnv7/yxDpYp9XSv2/nggr+0sw/1Usge10x5r/0eDzN14TYP3/jxWPus+k/sDJmi/VixT8Wok7h72rhvzHk4QfzJcK/RlWmGoUn4j8zIxQGO3e8v+Vm/4dm0vq/SJwyVXtOBMDTuvMtaDzUP60vYTlwMOC/3TQZhRjD8L950dHszSkCQMYfEXc+dOc/arwZ+vKf/b/2JqJ5Ctm5P8wb/zyoZOk/Jmzk67mb5z/YTUVzyPPpP70OQ34po+M/3AgeFLLI2z/VVnGL42HiP7jlXlHvN9s/22r6z/OZuz+S17fzIUbxP+D0togZwPi/85LXskxU0j9afrhOvWy4P84eTBF+Yuu/J+DTs3MV8z/NJONOyfOLv7we+9tcnei/EKP2hONR8r8E9Ge7J1LfPzsVzGSGmZk/Pc+giRz89L/D2v2VXH7gvzeyWkZgn+S/9w1dSQEH3D/ey9ojqPbjPwrCilOv3u0/TkYllrxe2T/BtPEcmdPhvxaUOe7aiHa/LUvjfzK1xb8c0gISr8j4P3BhLFKRQr0/ph+lSGxB8j8Ud1tQ6Of+P6nAKWsdUta/JtmYg6FQxb8FWAHC6039P/aWhkARttm/IFW3tJrNBECPJc4gkkTPvxE8HguCnOk/RMMPZicJxT+lpjv9scfjP/mO0w8Alv8/c4HLt2U13j+0Z4kHqKTav9e8c5cfGfS/6ByuolEazb9UtxxwwzD3Pymw05efA+q/UqMPh8af0j9TNb8DY6Hov3x4bKRSas0/3rUf++Ds1L9nEhVLhSLqv7gK06kR7wBA13lqLOSbzj+IxsYxG8H2P5kDuR7NsN4/GA8wJ4Vwx7+8+8y9MkbgP/TSfAkPwNm/OfRrR6N2AsAK6Nvv7HPlP1yuua+MT+8/JhSgWU5J2z8RoHE/vfrcPx9Y5TmpgtS/tZhfhQmAur+WpYIdqobTPyI0H0bvz+S/ClZuArfh9D+Wdb79RnDIv9vwTvcrMuG/8d/oQXAlA0C0g+4eNPHxP8kaeoJLi/U/i+viK3MJ4D/RdRnzcanpv3+DdI8pYPa/R7KfI8w14b/yQ9nj+YGzP3Sf/lWKWO0/VHJSom2x878nuDkBnB8AQPol1aI1OJC/Z3rZVZdPjz+4AMujmdzmPyFArT7VzNY/7wFDjJsaAUBWIJuh0FHcPwR6DAVbweC/Xvue4I2fAsB4fbqtwRqav20rWCMvQLu/sPp43xvf0b9f7p787Mu1v5QQA4UAAeo/2aSzvrb76D+tYXyIqCbHv6pKQgeZksA/HVDVGtwK/D+KmuUbk6XuPwI6ZI66sPy/3TadwEWn8T9BSM1BB5IEQIKvdtbSvvC/z9HAUCJX3b8B5naDLV/hP+eIuC0dItI/MVaENo7wxb9XAQ2u6tDBv4l1rQQflsK/fil0WdZB8b8jxVsRXKXkv6UoE8yxbda/zx2xZp7x8z/qO2ZOuF7vP/I+IkkXuNE/uCe7J/hv7j8xm8VArQ2WP7LB/kl6IP0/Lk30YHPqAsATG2GUv5PDv2vCh+nQaei/QNTGVQZg8z+5q8OiURDuv9pJVHGWg9O/9fKdNIp36j9Kb6bb7Xnxv1GqbG0zZOu/f2YuaiC45L9c+W0GCEnMv8a8V/5wVN4/tQHb+7T/9b90yuXxKhwPv6jtf3wr7/U/mqBmYj3O0b+pSEalL0PXv3si4uFxxr+/Gl55fWAxAMDPwABRk2Ppv6H7+kFLA/K/GrKxLYDQ5D9YUHQd30PnP0g+iwM/GMu/ZGbe8Kq6qj8Aaw4kZeqrvxJqO/HJYvy/6sLy3U7wAUCfjmVOZ7/xP5CmImTFo+a/D6/W1TWP3z93q3fl6dfDvw6E1OgUC9e/BweHqTLh7L9lQtQusJXaP4kwKhsdDuE/BfBJ3vcB0z8fti5cqRfjPzGGKa9uiAFAcWxF6Rh8+j/3syqwoXwBQO6TlM/j3vO//H5siZGM0z/wAPtmKIrZP8qM0rBc9eA/3AhFVjX92r+Us9KBrSCkv7Wzuf+tWtk/U8E9mnxQ0T8YAFnbSzz1P2soOs3KTMa/wUjIgQbk6T9vf9PDZxqgvw2oHvmYyLK/+S6iXA2TsT+lDDAvv8ukv84lxhGkl+I/nRhll87E1b9DipHzll7tv4Y5ko2LDec/YQQlk+jG0z/XxmBOPXXoP6ps8bCZkue/vARagmnj8L/LCnvxDMXZP0fbQN4zYsY/x4fhtGGK+7+yv3UsFZRuP0wN1m2Li9+/aUwIEq6T2r8pzP74RI7yP/DGQW9qabC//4lPg8ih8T+KJLFrnrHQP8FTGYksn50/Qa8/VQXV3T8skNMFzVX3P6ihXracXPa/iuQSzi/f9L/nEng5Fjfgv66AT9VgvwHARW4DjWtL+7838EwbwNChv9fJi/IoBeK/OAcsJKtL7b91LLMFYNveP2P7zy8e7eQ/HRFCHr0s4r8B0oYyoSf0v4WtzC6iW+M/ALUss7E43b8erGLJEgLEP7yJOEpqz9+/5Mmuyx9f+L9EQQ0ZrKDjP0M6t7MgUfM/NBZUV8508T8Gh42KccPwPy87ap7MxuC/mmOgcjf54z+HuDk2D3bBP1bOuupw/dk/tBF4+zJlgz+ftTQsZUTwP8lVRtAXfvy/7ETjiKx06z+U8CqS7gfMP9M5FMHNI8i/vqtBPv+e9T9BFk3vMnvUv333ssq4w+8/XqM7rwP5wD+qGLvSuxrzv0AhRQ5j8um/BWe5WVYh1r+mqKoA/sXdv+AX2osRxMo/vINHLiIj6r+wKqaqK5zPP9iP8Z2vkMK/Q1JUEBX+0D+roQdzLBu5P+6wKcJXmfC/hoV5uuJr1r+rzesNDnywvxHllYoMMvG/BuS870sXqb8En8ONrzDnvyHWTu7NPvS/dAr939uY5D8JZLL9aAzYvy0TNkXV0/M/npqhxmbQyL8b00N7F17dP/Hkk8znEtu/SJR+U/Li1z8Pzg58XiHWv+YnXiqSV+G/H22iDmqAyz9OGuFpZEfPvwI7BE4bYuI/DwiOBrBXuz/Kohpg6mK6vyLkKf3duvC/1CMK2tDJ9r8oO7N+m00AwG1t9rDXM+S/XrtMvaVMy7+KCjUmd1nMv2IRBZ9rAuG/KNXmT/Ew1r/rrG0GzzyQPy6ND+dlZvG/raPZ1Xca6j9zwEmEvMu9PzY9hr6mdOK/Ol55MuwUzD8AISZAv5Dgv1yl514tK/W/5KLX83ic1r8KlpBgu3HSvzJVZC8cOdE/t8Sfu4RC8b89zzRsY8/6PwmcrJLc9OA/CeJCABc57r87xnP627Lnv2/1hbH4NuY/9e/mKLyQ/j/2W5erKm7ivyjkV/pWFeg/nKTzS7oB8L/F9ORhTnLgPwrDq03KWvO/p79k41ue4b+kve+xNWDkv+qjdopG6fa/x0r4je5i5j8QOjYzbZn0v+so+if/iO6/LAMTkpV3zz9rtAj4RMffv1AdUqyTKsu/d+ffCunFxL8NK4I4MNHlv5c4ZEC01+o/Jg2g/ZEc8r9D41+6oijkPyOtd3JGkeO/pfIVl3jO0r8XeXBGUb3nP8ThNWST89m/AjXyxc8unb9V+QvKLIC5P7Sd4i96Ztw/o2MRhrG80b/JKSqOzR36P4Eghb/mRt0/bsmPfugE7z/yJn3AyefqP0n8ILrEov4/jLhw3L0MAEAtzBaGNz7nP+Syf7DbrOw//jN/Or0v8z/FF2n5kqjiv9PY4ynOse0/VutVVX208z+E6Oyi29nxv+28M1GFu8Q/wr0O1GaFxT/NLEZ4rprpPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[500]}},\"selected\":{\"id\":\"2410\"},\"selection_policy\":{\"id\":\"2409\"}},\"id\":\"2291\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2278\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2404\",\"type\":\"AllLabels\"},{\"attributes\":{\"source\":{\"id\":\"2291\"}},\"id\":\"2296\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2293\",\"type\":\"Circle\"}],\"root_ids\":[\"2260\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"52b7d887-871a-485f-9025-5fccb9e6b95e\",\"root_ids\":[\"2260\"],\"roots\":{\"2260\":\"45b3cb2a-0d56-4890-ad00-92e549b4a5ac\"}}];\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": "2260" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(x)\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": 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 = {\"fcdb2bf5-c710-406c-b23c-9c6ab88fb17e\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2476\"}],\"center\":[{\"id\":\"2479\"},{\"id\":\"2483\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2480\"}],\"renderers\":[{\"id\":\"2502\"},{\"id\":\"2508\"},{\"id\":\"2514\"},{\"id\":\"2520\"}],\"right\":[{\"id\":\"2522\"}],\"title\":{\"id\":\"2642\"},\"toolbar\":{\"id\":\"2491\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"2468\"},\"x_scale\":{\"id\":\"2472\"},\"y_range\":{\"id\":\"2470\"},\"y_scale\":{\"id\":\"2474\"}},\"id\":\"2467\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2489\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2488\",\"type\":\"ResetTool\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2490\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2506\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2648\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2653\",\"type\":\"Selection\"},{\"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\":\"2501\",\"type\":\"Circle\"},{\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"pHA9Ctej2L83iUFg5dDSvz81XrpJDNK/w/UoXI/C1b/ZzvdT46Xbv1pkO99Pjae/5dAi2/l+2r+TGARWDi2yv/yp8dJNYoC/Gy/dJAaBtb+Nl24Sg8DKvylcj8L1KKy/ObTIdr6fmr+F61G4HoXLv2iR7Xw/Nb6/IbByaJHtzL81XrpJDALLv6RwPQrXo9C/y6FFtvP91L9g5dAi2/m+vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"2653\"},\"selection_policy\":{\"id\":\"2652\"}},\"id\":\"2504\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2512\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2642\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2487\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2500\",\"type\":\"Circle\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2646\"},\"major_label_policy\":{\"id\":\"2645\"},\"ticker\":{\"id\":\"2477\"}},\"id\":\"2476\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2655\",\"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\":\"2507\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2485\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2656\",\"type\":\"UnionRenderers\"},{\"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\":\"2519\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2657\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"j8L1KFyP0r9eukkMAivHv39qvHSTGMS/w/UoXI/Cxb/fT42XbhLbv7pJDAIrh8a/PQrXo3A90r89CtejcD3Sv2Q730+Nl86/y6FFtvP91L9SuB6F61HYv99PjZduEtO/+n5qvHST6L9zaJHtfD/dv2Q730+Nl9a//tR46SYx0L9Ei2zn+6nRv6abxCCwctC/fT81XrpJ1L+mm8QgsHLYvw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"2651\"},\"selection_policy\":{\"id\":\"2650\"}},\"id\":\"2498\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2474\",\"type\":\"LinearScale\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2484\"},{\"id\":\"2485\"},{\"id\":\"2486\"},{\"id\":\"2487\"},{\"id\":\"2488\"},{\"id\":\"2489\"}]},\"id\":\"2491\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2645\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2470\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"2518\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2477\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"2498\"}},\"id\":\"2503\",\"type\":\"CDSView\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2523\"},{\"id\":\"2524\"},{\"id\":\"2525\"},{\"id\":\"2526\"}],\"location\":\"center\"},\"id\":\"2522\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"2498\"},\"glyph\":{\"id\":\"2500\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2501\"},\"view\":{\"id\":\"2503\"}},\"id\":\"2502\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2508\"}]},\"id\":\"2524\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2649\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2468\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2654\",\"type\":\"UnionRenderers\"},{\"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\":\"2513\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2650\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2516\"},\"glyph\":{\"id\":\"2518\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2519\"},\"view\":{\"id\":\"2521\"}},\"id\":\"2520\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2504\"}},\"id\":\"2509\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2504\"},\"glyph\":{\"id\":\"2506\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2507\"},\"view\":{\"id\":\"2509\"}},\"id\":\"2508\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"2476\"},\"ticker\":null},\"id\":\"2479\",\"type\":\"Grid\"},{\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"mpmZmZmZqb+q8dJNYhCovxBYObTIdr6/KVyPwvUovL9aZDvfT42Xvzm0yHa+n6q/YhBYObTItr97FK5H4XrEvyGwcmiR7cy/TDeJQWDloL+HFtnO91PDvxkEVg4tss2/lkOLbOf70b+q8dJNYhC4v4PAyqFFtrO/CKwcWmQ7v7+YbhKDwMrBvy2yne+nxsu/8tJNYhBYyb8IrBxaZDu/vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"2657\"},\"selection_policy\":{\"id\":\"2656\"}},\"id\":\"2516\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2472\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2651\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2520\"}]},\"id\":\"2526\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"2516\"}},\"id\":\"2521\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"2510\"}},\"id\":\"2515\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"/Knx0k1iUL/8qfHSTWKgv9NNYhBYObS/TDeJQWDlwL/Xo3A9CtfDvylcj8L1KLy/O99PjZduor/jpZvEILCyvylcj8L1KKy/8KfGSzeJwb+iRbbz/dTIvxsv3SQGgaW/BoGVQ4tsx7+cxCCwcmihvxkEVg4tsp2/y6FFtvP9tL+F61G4HoXLv+xRuB6F68G/aJHtfD81vr85tMh2vp/Kvw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"2655\"},\"selection_policy\":{\"id\":\"2654\"}},\"id\":\"2510\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2646\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2502\"}]},\"id\":\"2523\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"2510\"},\"glyph\":{\"id\":\"2512\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2513\"},\"view\":{\"id\":\"2515\"}},\"id\":\"2514\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2481\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2484\",\"type\":\"PanTool\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2514\"}]},\"id\":\"2525\",\"type\":\"LegendItem\"},{\"attributes\":{\"overlay\":{\"id\":\"2490\"}},\"id\":\"2486\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis\":{\"id\":\"2480\"},\"dimension\":1,\"ticker\":null},\"id\":\"2483\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2652\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2649\"},\"major_label_policy\":{\"id\":\"2648\"},\"ticker\":{\"id\":\"2481\"}},\"id\":\"2480\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"2467\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"fcdb2bf5-c710-406c-b23c-9c6ab88fb17e\",\"root_ids\":[\"2467\"],\"roots\":{\"2467\":\"6b8489c6-fb75-44b0-b7e6-41190b0d26f5\"}}];\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": "2467" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": 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 = {\"fc145640-9c5a-467f-b8fa-ed804a362ca8\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2753\"}],\"center\":[{\"id\":\"2756\"},{\"id\":\"2760\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2757\"}],\"renderers\":[{\"id\":\"2778\"},{\"id\":\"2783\"},{\"id\":\"2788\"},{\"id\":\"2793\"},{\"id\":\"2798\"},{\"id\":\"2803\"},{\"id\":\"2808\"},{\"id\":\"2813\"},{\"id\":\"2818\"},{\"id\":\"2823\"},{\"id\":\"2828\"},{\"id\":\"2833\"}],\"right\":[{\"id\":\"2835\"}],\"title\":{\"id\":\"2972\"},\"toolbar\":{\"id\":\"2768\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"2745\"},\"x_scale\":{\"id\":\"2749\"},\"y_range\":{\"id\":\"2747\"},\"y_scale\":{\"id\":\"2751\"}},\"id\":\"2744\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"2830\"}},\"id\":\"2834\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2825\"},\"glyph\":{\"id\":\"2826\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2827\"},\"view\":{\"id\":\"2829\"}},\"id\":\"2828\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2827\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"3001\"},\"selection_policy\":{\"id\":\"3000\"}},\"id\":\"2825\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2826\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2980\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2825\"}},\"id\":\"2829\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2832\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2981\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2831\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"3003\"},\"selection_policy\":{\"id\":\"3002\"}},\"id\":\"2830\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2830\"},\"glyph\":{\"id\":\"2831\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2832\"},\"view\":{\"id\":\"2834\"}},\"id\":\"2833\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2982\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2983\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2984\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2758\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2985\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2986\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2987\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2976\"},\"major_label_policy\":{\"id\":\"2975\"},\"ticker\":{\"id\":\"2754\"}},\"id\":\"2753\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"2757\"},\"dimension\":1,\"ticker\":null},\"id\":\"2760\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2972\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2745\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2975\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2988\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2976\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2989\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2808\"}]},\"id\":\"2838\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2751\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2747\",\"type\":\"DataRange1d\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2823\"}]},\"id\":\"2839\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2749\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2761\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2754\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2753\"},\"ticker\":null},\"id\":\"2756\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2979\"},\"major_label_policy\":{\"id\":\"2978\"},\"ticker\":{\"id\":\"2758\"}},\"id\":\"2757\",\"type\":\"LinearAxis\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2767\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2990\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2991\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3002\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2795\"},\"glyph\":{\"id\":\"2796\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2797\"},\"view\":{\"id\":\"2799\"}},\"id\":\"2798\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3003\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2992\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2979\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2985\"},\"selection_policy\":{\"id\":\"2984\"}},\"id\":\"2785\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2786\",\"type\":\"Ray\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2778\"}]},\"id\":\"2836\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2761\"},{\"id\":\"2762\"},{\"id\":\"2763\"},{\"id\":\"2764\"},{\"id\":\"2765\"},{\"id\":\"2766\"}]},\"id\":\"2768\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2993\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2785\"},\"glyph\":{\"id\":\"2786\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2787\"},\"view\":{\"id\":\"2789\"}},\"id\":\"2788\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2762\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2766\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2994\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"overlay\":{\"id\":\"2767\"}},\"id\":\"2763\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"2790\"}},\"id\":\"2794\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2995\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2790\"},\"glyph\":{\"id\":\"2791\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2792\"},\"view\":{\"id\":\"2794\"}},\"id\":\"2793\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2764\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2806\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2765\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQAAAAAAA0HBAAAAAAADQcEAAAAAAAJByQAAAAAAAkHJAAAAAAABwdEAAAAAAAHB0QAAAAAAA8HdAAAAAAADwd0AAAAAAADB7QAAAAAAAMHtAAAAAAACQfEAAAAAAAJB8QAAAAAAAGIBAAAAAAAAYgEAAAAAAAIiAQAAAAAAAiIBAAAAAAADogEAAAAAAAOiAQAAAAAAA6IJAAAAAAADogkAAAAAAAKCDQAAAAAAAoINAAAAAAAD4hUAAAAAAAPiFQAAAAAAA0IZAAAAAAADQhkAAAAAAAHiHQAAAAAAAeIdAAAAAAACQjUAAAAAAAJCNQAAAAAAAeJJAAAAAAAB4kkAAAAAAALSWQAAAAAAAtJZAAAAAAAAMmEAAAAAAAAyYQAAAAAAAMJlAAAAAAAAwmUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2987\"},\"selection_policy\":{\"id\":\"2986\"}},\"id\":\"2790\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2785\"}},\"id\":\"2789\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2791\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2775\"},\"glyph\":{\"id\":\"2776\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2777\"},\"view\":{\"id\":\"2779\"}},\"id\":\"2778\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2793\"}]},\"id\":\"2837\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"2780\"}},\"id\":\"2784\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QAAAAAAA0H5AAAAAAADQfkAAAAAAAGCBQAAAAAAAYIFAAAAAAAA4iEAAAAAAADiIQAAAAAAA1JJAAAAAAADUkkAAAAAAAGCTQAAAAAAAYJNAAAAAAAAIlEAAAAAAAAiUQAAAAAAAbJRAAAAAAABslEAAAAAAAByYQAAAAAAAHJhAAAAAAAAkmEAAAAAAACSYQAAAAAAAUJhAAAAAAABQmEAAAAAAAHCaQAAAAAAAcJpAAAAAAABEm0AAAAAAAESbQAAAAAAAjJ1AAAAAAACMnUAAAAAAAKSdQAAAAAAApJ1AAAAAAAAgnkAAAAAAACCeQAAAAAAAwJ9AAAAAAADAn0AAAAAAAMihQAAAAAAAyKFAAAAAAAC+o0AAAAAAAL6jQAAAAAAAoqRAAAAAAACipEA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2981\"},\"selection_policy\":{\"id\":\"2980\"}},\"id\":\"2775\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2776\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2775\"}},\"id\":\"2779\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2787\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2780\"},\"glyph\":{\"id\":\"2781\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2782\"},\"view\":{\"id\":\"2784\"}},\"id\":\"2783\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QAAAAAAAEHhAAAAAAAAQeEAAAAAAABB5QAAAAAAAEHlAAAAAAADgeUAAAAAAAOB5QAAAAAAAoHxAAAAAAACgfEAAAAAAALB8QAAAAAAAsHxAAAAAAACAfkAAAAAAAIB+QAAAAAAAuIBAAAAAAAC4gEAAAAAAANCAQAAAAAAA0IBAAAAAAAAAgUAAAAAAAACBQAAAAAAAAIFAAAAAAAAAgUAAAAAAABiCQAAAAAAAGIJAAAAAAAAYg0AAAAAAABiDQAAAAAAAMINAAAAAAAAwg0AAAAAAADCDQAAAAAAAMINAAAAAAABog0AAAAAAAGiDQAAAAAAAkINAAAAAAACQg0AAAAAAAMiEQAAAAAAAyIRAAAAAAABAiEAAAAAAAECIQAAAAAAAMIlAAAAAAAAwiUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2993\"},\"selection_policy\":{\"id\":\"2992\"}},\"id\":\"2805\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2781\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2996\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2782\",\"type\":\"Ray\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2777\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2997\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2983\"},\"selection_policy\":{\"id\":\"2982\"}},\"id\":\"2780\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2805\"},\"glyph\":{\"id\":\"2806\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2807\"},\"view\":{\"id\":\"2809\"}},\"id\":\"2808\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2797\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"2800\"}},\"id\":\"2804\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2989\"},\"selection_policy\":{\"id\":\"2988\"}},\"id\":\"2795\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2792\",\"type\":\"Line\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2796\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2810\"},\"glyph\":{\"id\":\"2811\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2812\"},\"view\":{\"id\":\"2814\"}},\"id\":\"2813\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2795\"}},\"id\":\"2799\",\"type\":\"CDSView\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2836\"},{\"id\":\"2837\"},{\"id\":\"2838\"},{\"id\":\"2839\"}],\"location\":\"center\"},\"id\":\"2835\",\"type\":\"Legend\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2802\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2998\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QAAAAAAAgEJAAAAAAACAQkAAAAAAAMBhQAAAAAAAwGFAAAAAAACAZUAAAAAAAIBlQAAAAAAAwGhAAAAAAADAaEAAAAAAAMBoQAAAAAAAwGhAAAAAAAAQcUAAAAAAABBxQAAAAAAAMHZAAAAAAAAwdkAAAAAAACB5QAAAAAAAIHlAAAAAAABQfEAAAAAAAFB8QAAAAAAAQH1AAAAAAABAfUAAAAAAAGB/QAAAAAAAYH9AAAAAAAAggEAAAAAAACCAQAAAAAAAMIJAAAAAAAAwgkAAAAAAAKiCQAAAAAAAqIJAAAAAAADogkAAAAAAAOiCQAAAAAAAMINAAAAAAAAwg0AAAAAAADiGQAAAAAAAOIZAAAAAAACAhkAAAAAAAICGQAAAAAAAeIlAAAAAAAB4iUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2999\"},\"selection_policy\":{\"id\":\"2998\"}},\"id\":\"2820\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2801\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2991\"},\"selection_policy\":{\"id\":\"2990\"}},\"id\":\"2800\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2999\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2821\",\"type\":\"Line\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2995\"},\"selection_policy\":{\"id\":\"2994\"}},\"id\":\"2810\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2800\"},\"glyph\":{\"id\":\"2801\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2802\"},\"view\":{\"id\":\"2804\"}},\"id\":\"2803\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2978\",\"type\":\"AllLabels\"},{\"attributes\":{\"data_source\":{\"id\":\"2820\"},\"glyph\":{\"id\":\"2821\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2822\"},\"view\":{\"id\":\"2824\"}},\"id\":\"2823\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2805\"}},\"id\":\"2809\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2811\",\"type\":\"Ray\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2807\",\"type\":\"Line\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2812\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"2815\"}},\"id\":\"2819\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3000\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2810\"}},\"id\":\"2814\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2817\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"3001\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"2820\"}},\"id\":\"2824\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2816\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2997\"},\"selection_policy\":{\"id\":\"2996\"}},\"id\":\"2815\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2822\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2815\"},\"glyph\":{\"id\":\"2816\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2817\"},\"view\":{\"id\":\"2819\"}},\"id\":\"2818\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"2744\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"fc145640-9c5a-467f-b8fa-ed804a362ca8\",\"root_ids\":[\"2744\"],\"roots\":{\"2744\":\"a0121225-7f1b-40e8-a0f2-09f1da89cfab\"}}];\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": "2744" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": 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 = {\"eead8d91-453f-4039-9ed8-de54c896f786\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2753\"}],\"center\":[{\"id\":\"2756\"},{\"id\":\"2760\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2757\"}],\"renderers\":[{\"id\":\"2778\"},{\"id\":\"2783\"},{\"id\":\"2788\"},{\"id\":\"2793\"},{\"id\":\"2798\"},{\"id\":\"2803\"},{\"id\":\"2808\"},{\"id\":\"2813\"},{\"id\":\"2818\"},{\"id\":\"2823\"},{\"id\":\"2828\"},{\"id\":\"2833\"},{\"id\":\"3174\"},{\"id\":\"3347\"},{\"id\":\"3522\"},{\"id\":\"3699\"}],\"right\":[{\"id\":\"2835\"}],\"title\":{\"id\":\"2972\"},\"toolbar\":{\"id\":\"2768\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"2745\"},\"x_scale\":{\"id\":\"2749\"},\"y_range\":{\"id\":\"2747\"},\"y_scale\":{\"id\":\"2751\"}},\"id\":\"2744\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"3871\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2830\"}},\"id\":\"2834\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3872\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2825\"},\"glyph\":{\"id\":\"2826\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2827\"},\"view\":{\"id\":\"2829\"}},\"id\":\"2828\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2827\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"3001\"},\"selection_policy\":{\"id\":\"3000\"}},\"id\":\"2825\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":22.0},\"y\":{\"value\":0}},\"id\":\"2826\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2980\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2825\"}},\"id\":\"2829\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2832\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2981\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":815.0},\"y\":{\"value\":1}},\"id\":\"2831\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"3003\"},\"selection_policy\":{\"id\":\"3002\"}},\"id\":\"2830\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2830\"},\"glyph\":{\"id\":\"2831\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2832\"},\"view\":{\"id\":\"2834\"}},\"id\":\"2833\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2982\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2983\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2984\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2758\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2985\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"3518\"},\"glyph\":{\"id\":\"3520\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3521\"},\"view\":{\"id\":\"3523\"}},\"id\":\"3522\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2986\",\"type\":\"UnionRenderers\"},{\"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\":\"3521\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2987\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"2976\"},\"major_label_policy\":{\"id\":\"2975\"},\"ticker\":{\"id\":\"2754\"}},\"id\":\"2753\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"2757\"},\"dimension\":1,\"ticker\":null},\"id\":\"2760\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"3518\"}},\"id\":\"3523\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2972\",\"type\":\"Title\"},{\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"j8L1KFyP0r9eukkMAivHv39qvHSTGMS/w/UoXI/Cxb/fT42XbhLbv7pJDAIrh8a/PQrXo3A90r89CtejcD3Sv2Q730+Nl86/y6FFtvP91L9SuB6F61HYv99PjZduEtO/+n5qvHST6L9zaJHtfD/dv2Q730+Nl9a//tR46SYx0L9Ei2zn+6nRv6abxCCwctC/fT81XrpJ1L+mm8QgsHLYvw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"3341\"},\"selection_policy\":{\"id\":\"3340\"}},\"id\":\"3170\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2745\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2975\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2988\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2976\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2989\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"2808\"}]},\"id\":\"2838\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2751\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2747\",\"type\":\"DataRange1d\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"2823\"}]},\"id\":\"2839\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2749\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2761\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2754\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2753\"},\"ticker\":null},\"id\":\"2756\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3697\",\"type\":\"Circle\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"2979\"},\"major_label_policy\":{\"id\":\"2978\"},\"ticker\":{\"id\":\"2758\"}},\"id\":\"2757\",\"type\":\"LinearAxis\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2767\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2990\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2991\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3002\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3692\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2795\"},\"glyph\":{\"id\":\"2796\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2797\"},\"view\":{\"id\":\"2799\"}},\"id\":\"2798\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3003\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2992\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2979\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2985\"},\"selection_policy\":{\"id\":\"2984\"}},\"id\":\"2785\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2786\",\"type\":\"Ray\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"2778\"}]},\"id\":\"2836\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2761\"},{\"id\":\"2762\"},{\"id\":\"2763\"},{\"id\":\"2764\"},{\"id\":\"2765\"},{\"id\":\"2766\"}]},\"id\":\"2768\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2993\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2785\"},\"glyph\":{\"id\":\"2786\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2787\"},\"view\":{\"id\":\"2789\"}},\"id\":\"2788\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3516\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3515\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2762\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"3693\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"pHA9Ctej2L83iUFg5dDSvz81XrpJDNK/w/UoXI/C1b/ZzvdT46Xbv1pkO99Pjae/5dAi2/l+2r+TGARWDi2yv/yp8dJNYoC/Gy/dJAaBtb+Nl24Sg8DKvylcj8L1KKy/ObTIdr6fmr+F61G4HoXLv2iR7Xw/Nb6/IbByaJHtzL81XrpJDALLv6RwPQrXo9C/y6FFtvP91L9g5dAi2/m+vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"3516\"},\"selection_policy\":{\"id\":\"3515\"}},\"id\":\"3343\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2766\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2994\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"overlay\":{\"id\":\"2767\"}},\"id\":\"2763\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"2790\"}},\"id\":\"2794\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2995\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2790\"},\"glyph\":{\"id\":\"2791\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2792\"},\"view\":{\"id\":\"2794\"}},\"id\":\"2793\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3520\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2764\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2806\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2765\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACgbkAAAAAAAKBuQAAAAAAA0HBAAAAAAADQcEAAAAAAAJByQAAAAAAAkHJAAAAAAABwdEAAAAAAAHB0QAAAAAAA8HdAAAAAAADwd0AAAAAAADB7QAAAAAAAMHtAAAAAAACQfEAAAAAAAJB8QAAAAAAAGIBAAAAAAAAYgEAAAAAAAIiAQAAAAAAAiIBAAAAAAADogEAAAAAAAOiAQAAAAAAA6IJAAAAAAADogkAAAAAAAKCDQAAAAAAAoINAAAAAAAD4hUAAAAAAAPiFQAAAAAAA0IZAAAAAAADQhkAAAAAAAHiHQAAAAAAAeIdAAAAAAACQjUAAAAAAAJCNQAAAAAAAeJJAAAAAAAB4kkAAAAAAALSWQAAAAAAAtJZAAAAAAAAMmEAAAAAAAAyYQAAAAAAAMJlAAAAAAAAwmUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2987\"},\"selection_policy\":{\"id\":\"2986\"}},\"id\":\"2790\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2785\"}},\"id\":\"2789\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2791\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2775\"},\"glyph\":{\"id\":\"2776\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2777\"},\"view\":{\"id\":\"2779\"}},\"id\":\"2778\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"2793\"}]},\"id\":\"2837\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"2780\"}},\"id\":\"2784\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACQfUAAAAAAAJB9QAAAAAAA0H5AAAAAAADQfkAAAAAAAGCBQAAAAAAAYIFAAAAAAAA4iEAAAAAAADiIQAAAAAAA1JJAAAAAAADUkkAAAAAAAGCTQAAAAAAAYJNAAAAAAAAIlEAAAAAAAAiUQAAAAAAAbJRAAAAAAABslEAAAAAAAByYQAAAAAAAHJhAAAAAAAAkmEAAAAAAACSYQAAAAAAAUJhAAAAAAABQmEAAAAAAAHCaQAAAAAAAcJpAAAAAAABEm0AAAAAAAESbQAAAAAAAjJ1AAAAAAACMnUAAAAAAAKSdQAAAAAAApJ1AAAAAAAAgnkAAAAAAACCeQAAAAAAAwJ9AAAAAAADAn0AAAAAAAMihQAAAAAAAyKFAAAAAAAC+o0AAAAAAAL6jQAAAAAAAoqRAAAAAAACipEA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2981\"},\"selection_policy\":{\"id\":\"2980\"}},\"id\":\"2775\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2776\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2775\"}},\"id\":\"2779\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":2641.0},\"y\":{\"value\":1}},\"id\":\"2787\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2780\"},\"glyph\":{\"id\":\"2781\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2782\"},\"view\":{\"id\":\"2784\"}},\"id\":\"2783\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAABAdEAAAAAAAEB0QAAAAAAAEHhAAAAAAAAQeEAAAAAAABB5QAAAAAAAEHlAAAAAAADgeUAAAAAAAOB5QAAAAAAAoHxAAAAAAACgfEAAAAAAALB8QAAAAAAAsHxAAAAAAACAfkAAAAAAAIB+QAAAAAAAuIBAAAAAAAC4gEAAAAAAANCAQAAAAAAA0IBAAAAAAAAAgUAAAAAAAACBQAAAAAAAAIFAAAAAAAAAgUAAAAAAABiCQAAAAAAAGIJAAAAAAAAYg0AAAAAAABiDQAAAAAAAMINAAAAAAAAwg0AAAAAAADCDQAAAAAAAMINAAAAAAABog0AAAAAAAGiDQAAAAAAAkINAAAAAAACQg0AAAAAAAMiEQAAAAAAAyIRAAAAAAABAiEAAAAAAAECIQAAAAAAAMIlAAAAAAAAwiUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2993\"},\"selection_policy\":{\"id\":\"2992\"}},\"id\":\"2805\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2781\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2996\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":473.0},\"y\":{\"value\":0}},\"id\":\"2782\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"3341\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2777\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2997\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2983\"},\"selection_policy\":{\"id\":\"2982\"}},\"id\":\"2780\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2805\"},\"glyph\":{\"id\":\"2806\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2807\"},\"view\":{\"id\":\"2809\"}},\"id\":\"2808\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2797\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"3340\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2800\"}},\"id\":\"2804\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2989\"},\"selection_policy\":{\"id\":\"2988\"}},\"id\":\"2795\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3695\"}},\"id\":\"3700\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2792\",\"type\":\"Line\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":245.0},\"y\":{\"value\":0}},\"id\":\"2796\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2810\"},\"glyph\":{\"id\":\"2811\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2812\"},\"view\":{\"id\":\"2814\"}},\"id\":\"2813\",\"type\":\"GlyphRenderer\"},{\"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\":\"3346\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"2795\"}},\"id\":\"2799\",\"type\":\"CDSView\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"2836\"},{\"id\":\"2837\"},{\"id\":\"2838\"},{\"id\":\"2839\"}],\"location\":\"center\"},\"id\":\"2835\",\"type\":\"Legend\"},{\"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\":\"3173\",\"type\":\"Circle\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2802\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2998\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAANkAAAAAAAAA2QAAAAAAAgEJAAAAAAACAQkAAAAAAAMBhQAAAAAAAwGFAAAAAAACAZUAAAAAAAIBlQAAAAAAAwGhAAAAAAADAaEAAAAAAAMBoQAAAAAAAwGhAAAAAAAAQcUAAAAAAABBxQAAAAAAAMHZAAAAAAAAwdkAAAAAAACB5QAAAAAAAIHlAAAAAAABQfEAAAAAAAFB8QAAAAAAAQH1AAAAAAABAfUAAAAAAAGB/QAAAAAAAYH9AAAAAAAAggEAAAAAAACCAQAAAAAAAMIJAAAAAAAAwgkAAAAAAAKiCQAAAAAAAqIJAAAAAAADogkAAAAAAAOiCQAAAAAAAMINAAAAAAAAwg0AAAAAAADiGQAAAAAAAOIZAAAAAAACAhkAAAAAAAICGQAAAAAAAeIlAAAAAAAB4iUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[40]}},\"selected\":{\"id\":\"2999\"},\"selection_policy\":{\"id\":\"2998\"}},\"id\":\"2820\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":1612.0},\"y\":{\"value\":1}},\"id\":\"2801\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2991\"},\"selection_policy\":{\"id\":\"2990\"}},\"id\":\"2800\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2999\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2821\",\"type\":\"Line\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2995\"},\"selection_policy\":{\"id\":\"2994\"}},\"id\":\"2810\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3345\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"2800\"},\"glyph\":{\"id\":\"2801\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2802\"},\"view\":{\"id\":\"2804\"}},\"id\":\"2803\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2978\",\"type\":\"AllLabels\"},{\"attributes\":{\"data_source\":{\"id\":\"2820\"},\"glyph\":{\"id\":\"2821\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2822\"},\"view\":{\"id\":\"2824\"}},\"id\":\"2823\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2805\"}},\"id\":\"2809\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2811\",\"type\":\"Ray\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2807\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"3170\"}},\"id\":\"3175\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":324.0},\"y\":{\"value\":0}},\"id\":\"2812\",\"type\":\"Ray\"},{\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"/Knx0k1iUL/8qfHSTWKgv9NNYhBYObS/TDeJQWDlwL/Xo3A9CtfDvylcj8L1KLy/O99PjZduor/jpZvEILCyvylcj8L1KKy/8KfGSzeJwb+iRbbz/dTIvxsv3SQGgaW/BoGVQ4tsx7+cxCCwcmihvxkEVg4tsp2/y6FFtvP9tL+F61G4HoXLv+xRuB6F68G/aJHtfD81vr85tMh2vp/Kvw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"3693\"},\"selection_policy\":{\"id\":\"3692\"}},\"id\":\"3518\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2815\"}},\"id\":\"2819\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3170\"},\"glyph\":{\"id\":\"3172\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3173\"},\"view\":{\"id\":\"3175\"}},\"id\":\"3174\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3000\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2810\"}},\"id\":\"2814\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3172\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"3343\"},\"glyph\":{\"id\":\"3345\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3346\"},\"view\":{\"id\":\"3348\"}},\"id\":\"3347\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2817\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"3001\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"3695\"},\"glyph\":{\"id\":\"3697\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3698\"},\"view\":{\"id\":\"3700\"}},\"id\":\"3699\",\"type\":\"GlyphRenderer\"},{\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"shape\":[20]},\"adhesive impulse (N-s)\":{\"__ndarray__\":\"mpmZmZmZqb+q8dJNYhCovxBYObTIdr6/KVyPwvUovL9aZDvfT42Xvzm0yHa+n6q/YhBYObTItr97FK5H4XrEvyGwcmiR7cy/TDeJQWDloL+HFtnO91PDvxkEVg4tss2/lkOLbOf70b+q8dJNYhC4v4PAyqFFtrO/CKwcWmQ7v7+YbhKDwMrBvy2yne+nxsu/8tJNYhBYyb8IrBxaZDu/vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\",\"order\":\"little\",\"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\":\"3872\"},\"selection_policy\":{\"id\":\"3871\"}},\"id\":\"3695\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2820\"}},\"id\":\"2824\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"3343\"}},\"id\":\"3348\",\"type\":\"CDSView\"},{\"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\":\"3698\",\"type\":\"Circle\"},{\"attributes\":{\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":806.0},\"y\":{\"value\":1}},\"id\":\"2816\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2997\"},\"selection_policy\":{\"id\":\"2996\"}},\"id\":\"2815\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2822\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2815\"},\"glyph\":{\"id\":\"2816\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2817\"},\"view\":{\"id\":\"2819\"}},\"id\":\"2818\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"2744\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"eead8d91-453f-4039-9ed8-de54c896f786\",\"root_ids\":[\"2744\"],\"roots\":{\"2744\":\"24e70cae-294c-43e6-b07c-86240750c9e9\"}}];\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": "2744" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\n", " p=p,\n", " show_legend=False,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Customization with iqplot\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 plotting functions also has the following additional optional keyword arguments, as described above.\n", "\n", "- `q_axis`: Along which axis, x or y that the quantitative variable varies. The default is `'x'`.\n", "- `palette`: A list of hex colors to use for coloring the markers for each category. By default, it uses the Glasbey Category 10 color palette from [colorcet](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 `iqplot.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", "iqplot.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 vertical box plots." ] }, { "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 = {\"a978cd54-4453-4cd0-b0fe-85da3d79446d\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4088\"}],\"center\":[{\"id\":\"4090\"},{\"id\":\"4094\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"4091\"}],\"renderers\":[{\"id\":\"4117\"},{\"id\":\"4122\"},{\"id\":\"4127\"},{\"id\":\"4132\"},{\"id\":\"4137\"}],\"title\":{\"id\":\"4312\"},\"toolbar\":{\"id\":\"4102\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"4079\"},\"x_scale\":{\"id\":\"4084\"},\"y_range\":{\"id\":\"4082\"},\"y_scale\":{\"id\":\"4086\"}},\"id\":\"4080\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4092\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4100\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"4095\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"4101\"}},\"id\":\"4097\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4098\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4318\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"4099\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4316\",\"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\":\"4113\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"4115\",\"type\":\"Segment\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"4116\",\"type\":\"Segment\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"4323\"},\"selection_policy\":{\"id\":\"4322\"}},\"id\":\"4110\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"4121\",\"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\":\"4112\",\"type\":\"CategoricalColorMapper\"},{\"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\":\"4131\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"4109\"},\"glyph\":{\"id\":\"4120\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4121\"},\"view\":{\"id\":\"4123\"}},\"id\":\"4122\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4315\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"4320\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4312\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"4082\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4113\"}},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4125\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"4109\"}},\"id\":\"4128\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4111\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4112\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"4135\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"4109\"},\"glyph\":{\"id\":\"4125\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4126\"},\"view\":{\"id\":\"4128\"}},\"id\":\"4127\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4321\",\"type\":\"Selection\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4113\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4126\",\"type\":\"VBar\"},{\"attributes\":{\"factors\":[\"I\",\"II\",\"III\",\"IV\"]},\"id\":\"4079\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"4109\"},\"glyph\":{\"id\":\"4130\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4131\"},\"view\":{\"id\":\"4133\"}},\"id\":\"4132\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4319\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4111\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4112\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"impact force (mN)\"}},\"id\":\"4136\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"4096\",\"type\":\"WheelZoomTool\"},{\"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\":\"4321\"},\"selection_policy\":{\"id\":\"4320\"}},\"id\":\"4109\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"4130\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"4084\",\"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\":\"4111\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"4322\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"4319\"},\"major_label_policy\":{\"id\":\"4318\"},\"ticker\":{\"id\":\"4092\"}},\"id\":\"4091\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"4110\"},\"glyph\":{\"id\":\"4135\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4136\"},\"view\":{\"id\":\"4138\"}},\"id\":\"4137\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4086\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4323\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"4316\"},\"major_label_policy\":{\"id\":\"4315\"},\"ticker\":{\"id\":\"4089\"}},\"id\":\"4088\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"4109\"},\"glyph\":{\"id\":\"4115\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4116\"},\"view\":{\"id\":\"4118\"}},\"id\":\"4117\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4089\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"4120\",\"type\":\"Segment\"},{\"attributes\":{\"axis\":{\"id\":\"4088\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"4090\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"4109\"}},\"id\":\"4133\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"4101\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"4095\"},{\"id\":\"4096\"},{\"id\":\"4097\"},{\"id\":\"4098\"},{\"id\":\"4099\"},{\"id\":\"4100\"}]},\"id\":\"4102\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"4109\"}},\"id\":\"4123\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"4110\"}},\"id\":\"4138\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"4109\"}},\"id\":\"4118\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"4091\"},\"dimension\":1,\"ticker\":null},\"id\":\"4094\",\"type\":\"Grid\"}],\"root_ids\":[\"4080\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"a978cd54-4453-4cd0-b0fe-85da3d79446d\",\"root_ids\":[\"4080\"],\"roots\":{\"4080\":\"7a35ac49-1c3f-4895-a552-8cb24d1fffb3\"}}];\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": "4080" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.box(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\n", " q_axis='y',\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": 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 = {\"63915797-95e7-4fc0-9ac7-b26707df2a66\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4399\"}],\"center\":[{\"id\":\"4402\"},{\"id\":\"4405\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"4403\"}],\"renderers\":[{\"id\":\"4425\"},{\"id\":\"4430\"},{\"id\":\"4435\"},{\"id\":\"4440\"},{\"id\":\"4445\"},{\"id\":\"4450\"},{\"id\":\"4455\"}],\"title\":{\"id\":\"4643\"},\"toolbar\":{\"id\":\"4413\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"4392\"},\"x_scale\":{\"id\":\"4395\"},\"y_range\":{\"id\":\"4390\"},\"y_scale\":{\"id\":\"4397\"}},\"id\":\"4391\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"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\":\"4449\",\"type\":\"HBar\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4428\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4429\"},\"view\":{\"id\":\"4431\"}},\"id\":\"4430\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4444\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"4653\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4426\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4643\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4446\",\"type\":\"CDSView\"},{\"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\":\"#7C0000\"},\"line_width\":{\"value\":2},\"right\":{\"field\":\"top_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4434\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"4421\"}},\"id\":\"4456\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4654\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4428\",\"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\":\"4652\"},\"selection_policy\":{\"id\":\"4651\"}},\"id\":\"4420\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4448\",\"type\":\"HBar\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4438\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4439\"},\"view\":{\"id\":\"4441\"}},\"id\":\"4440\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7C0000\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4443\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"4647\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"top_whisker\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"right\":{\"field\":\"top_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4433\",\"type\":\"HBar\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4433\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4434\"},\"view\":{\"id\":\"4436\"}},\"id\":\"4435\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4436\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4651\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4441\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"4390\",\"type\":\"FactorRange\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4429\",\"type\":\"Segment\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":\"#7C0000\"},\"marker\":{\"value\":\"diamond\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4453\",\"type\":\"Scatter\"},{\"attributes\":{},\"id\":\"4652\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4443\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4444\"},\"view\":{\"id\":\"4446\"}},\"id\":\"4445\",\"type\":\"GlyphRenderer\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"4412\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4423\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4424\"},\"view\":{\"id\":\"4426\"}},\"id\":\"4425\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4392\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.1},\"left\":{\"field\":\"bottom_whisker\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"right\":{\"field\":\"bottom_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4438\",\"type\":\"HBar\"},{\"attributes\":{\"data_source\":{\"id\":\"4420\"},\"glyph\":{\"id\":\"4448\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4449\"},\"view\":{\"id\":\"4451\"}},\"id\":\"4450\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4646\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"4400\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4431\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4395\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4424\",\"type\":\"Segment\"},{\"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\":\"#7C0000\"},\"line_width\":{\"value\":2},\"right\":{\"field\":\"bottom_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4439\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"4649\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"4399\"},\"ticker\":null},\"id\":\"4402\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"marker\":{\"value\":\"diamond\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4454\",\"type\":\"Scatter\"},{\"attributes\":{},\"id\":\"4397\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data_source\":{\"id\":\"4421\"},\"glyph\":{\"id\":\"4453\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4454\"},\"view\":{\"id\":\"4456\"}},\"id\":\"4455\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"ID\":[\"II\",\"II\",\"II\"],\"__label\":[\"II\",\"II\",\"II\"],\"cat\":[\"II\",\"II\",\"II\"],\"impact force (mN)\":[1612,1539,1453]},\"selected\":{\"id\":\"4654\"},\"selection_policy\":{\"id\":\"4653\"}},\"id\":\"4421\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"4647\"},\"major_label_policy\":{\"id\":\"4646\"},\"ticker\":{\"id\":\"4400\"}},\"id\":\"4399\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4650\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"4420\"}},\"id\":\"4451\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4411\",\"type\":\"HelpTool\"},{\"attributes\":{\"formatter\":{\"id\":\"4650\"},\"major_label_policy\":{\"id\":\"4649\"},\"ticker\":{\"id\":\"4404\"}},\"id\":\"4403\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"4403\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"4405\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4404\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"4407\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"4423\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"4406\",\"type\":\"PanTool\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"4406\"},{\"id\":\"4407\"},{\"id\":\"4408\"},{\"id\":\"4409\"},{\"id\":\"4410\"},{\"id\":\"4411\"}]},\"id\":\"4413\",\"type\":\"Toolbar\"},{\"attributes\":{\"overlay\":{\"id\":\"4412\"}},\"id\":\"4408\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4409\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4410\",\"type\":\"ResetTool\"}],\"root_ids\":[\"4391\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"63915797-95e7-4fc0-9ac7-b26707df2a66\",\"root_ids\":[\"4391\"],\"roots\":{\"4391\":\"f29c54d5-c50c-4b71-9e99-a629cac820bf\"}}];\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": "4391" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.box(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": 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 = {\"e4d1f009-2a23-460a-b1f6-84a7f90bf952\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4730\"}],\"center\":[{\"id\":\"4733\"},{\"id\":\"4736\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"4734\"}],\"renderers\":[{\"id\":\"4756\"}],\"title\":{\"id\":\"4957\"},\"toolbar\":{\"id\":\"4744\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"4723\"},\"x_scale\":{\"id\":\"4726\"},\"y_range\":{\"id\":\"4721\"},\"y_scale\":{\"id\":\"4728\"}},\"id\":\"4722\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4735\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"4964\"},\"major_label_policy\":{\"id\":\"4963\"},\"ticker\":{\"id\":\"4735\"}},\"id\":\"4734\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"source\":{\"id\":\"4752\"}},\"id\":\"4757\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4965\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4966\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4960\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"4730\"},\"ticker\":null},\"id\":\"4733\",\"type\":\"Grid\"},{\"attributes\":{\"angle\":{\"value\":1.5707963267948966},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4751\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4751\"}},\"marker\":{\"value\":\"dash\"},\"size\":{\"value\":37.5},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4755\",\"type\":\"Scatter\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"4737\"},{\"id\":\"4738\"},{\"id\":\"4739\"},{\"id\":\"4740\"},{\"id\":\"4741\"},{\"id\":\"4742\"}]},\"id\":\"4744\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"4957\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"4752\"},\"glyph\":{\"id\":\"4754\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4755\"},\"view\":{\"id\":\"4757\"}},\"id\":\"4756\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4963\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"4737\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4742\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"4964\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"4741\",\"type\":\"ResetTool\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"4743\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4723\",\"type\":\"DataRange1d\"},{\"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\":\"4751\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"4721\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"4738\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"angle\":{\"value\":1.5707963267948966},\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4751\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"4751\"}},\"marker\":{\"value\":\"dash\"},\"size\":{\"value\":37.5},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"4754\",\"type\":\"Scatter\"},{\"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\":\"4966\"},\"selection_policy\":{\"id\":\"4965\"}},\"id\":\"4752\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4740\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4961\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4731\",\"type\":\"BasicTicker\"},{\"attributes\":{\"overlay\":{\"id\":\"4743\"}},\"id\":\"4739\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"4961\"},\"major_label_policy\":{\"id\":\"4960\"},\"ticker\":{\"id\":\"4731\"}},\"id\":\"4730\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"4734\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"4736\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4728\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"4726\",\"type\":\"LinearScale\"}],\"root_ids\":[\"4722\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"e4d1f009-2a23-460a-b1f6-84a7f90bf952\",\"root_ids\":[\"4722\"],\"roots\":{\"4722\":\"61c4e185-8c07-4084-abd4-ea2b9cff9035\"}}];\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": "4722" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": 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 = {\"89c127a4-0008-4697-97b3-5cb3efe2b9e2\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5032\"}],\"center\":[{\"id\":\"5035\"},{\"id\":\"5038\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"5036\"}],\"renderers\":[{\"id\":\"5061\"}],\"title\":{\"id\":\"5273\"},\"toolbar\":{\"id\":\"5046\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"5025\"},\"x_scale\":{\"id\":\"5028\"},\"y_range\":{\"id\":\"5023\"},\"y_scale\":{\"id\":\"5030\"}},\"id\":\"5024\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"5056\"}},\"id\":\"5062\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5055\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5055\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"5057\"}}},\"id\":\"5060\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5280\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"5277\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5279\",\"type\":\"AllLabels\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"5023\"},\"width\":0.1},\"id\":\"5057\",\"type\":\"Jitter\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5055\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"5055\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"5057\"}}},\"id\":\"5059\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5276\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"5281\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"5045\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"factors\":[\"IV\",\"III\",\"II\",\"I\"]},\"id\":\"5023\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"trial\",\"@{trial number}\"],[\"adh force\",\"@{adhesive force (mN)}\"]]},\"id\":\"5053\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"5282\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"5025\",\"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\",\"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\":\"5282\"},\"selection_policy\":{\"id\":\"5281\"}},\"id\":\"5056\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5273\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5033\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5028\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"5032\"},\"ticker\":null},\"id\":\"5035\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5030\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5277\"},\"major_label_policy\":{\"id\":\"5276\"},\"ticker\":{\"id\":\"5033\"}},\"id\":\"5032\",\"type\":\"LinearAxis\"},{\"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\":\"5055\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"5044\",\"type\":\"HelpTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5280\"},\"major_label_policy\":{\"id\":\"5279\"},\"ticker\":{\"id\":\"5037\"}},\"id\":\"5036\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"5036\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"5038\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5037\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"5039\"},{\"id\":\"5040\"},{\"id\":\"5041\"},{\"id\":\"5042\"},{\"id\":\"5043\"},{\"id\":\"5044\"},{\"id\":\"5053\"}]},\"id\":\"5046\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5040\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5039\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"5045\"}},\"id\":\"5041\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5042\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5043\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"5056\"},\"glyph\":{\"id\":\"5059\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5060\"},\"view\":{\"id\":\"5062\"}},\"id\":\"5061\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"5024\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"89c127a4-0008-4697-97b3-5cb3efe2b9e2\",\"root_ids\":[\"5024\"],\"roots\":{\"5024\":\"26bea41a-a5a8-44a1-b313-e4b83dd7e4d2\"}}];\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": "5024" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\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": 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 = {\"ca25bd9a-642a-4821-bb6c-d68e650ac8de\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5348\"}],\"center\":[{\"id\":\"5351\"},{\"id\":\"5354\"}],\"frame_height\":275,\"left\":[{\"id\":\"5352\"}],\"renderers\":[{\"id\":\"5374\"}],\"title\":{\"id\":\"5597\"},\"toolbar\":{\"id\":\"5362\"},\"toolbar_location\":\"above\",\"width\":550,\"x_range\":{\"id\":\"5341\"},\"x_scale\":{\"id\":\"5344\"},\"y_range\":{\"id\":\"5339\"},\"y_scale\":{\"id\":\"5346\"}},\"id\":\"5340\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"5597\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"5370\"},\"glyph\":{\"id\":\"5372\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5373\"},\"view\":{\"id\":\"5375\"}},\"id\":\"5374\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"5349\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5369\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5369\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"5373\",\"type\":\"Circle\"},{\"attributes\":{\"factors\":[[\"IV\",\"4\"],[\"IV\",\"3\"],[\"IV\",\"2\"],[\"IV\",\"1\"],[\"III\",\"4\"],[\"III\",\"3\"],[\"III\",\"2\"],[\"III\",\"1\"],[\"II\",\"4\"],[\"II\",\"3\"],[\"II\",\"2\"],[\"II\",\"1\"],[\"I\",\"5\"],[\"I\",\"4\"],[\"I\",\"3\"],[\"I\",\"2\"],[\"I\",\"1\"]]},\"id\":\"5339\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"5604\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"5344\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"5341\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"5370\"}},\"id\":\"5375\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"5601\"},\"major_label_policy\":{\"id\":\"5600\"},\"ticker\":{\"id\":\"5349\"}},\"id\":\"5348\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5605\",\"type\":\"UnionRenderers\"},{\"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\":\"5369\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis\":{\"id\":\"5348\"},\"ticker\":null},\"id\":\"5351\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5606\",\"type\":\"Selection\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"5355\"},{\"id\":\"5356\"},{\"id\":\"5357\"},{\"id\":\"5358\"},{\"id\":\"5359\"},{\"id\":\"5360\"}]},\"id\":\"5362\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5369\"}},\"line_color\":{\"field\":\"trial number\",\"transform\":{\"id\":\"5369\"}},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"cat\"}},\"id\":\"5372\",\"type\":\"Circle\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"5361\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5346\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"overlay\":{\"id\":\"5361\"}},\"id\":\"5357\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5603\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"5360\",\"type\":\"HelpTool\"},{\"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\":\"5606\"},\"selection_policy\":{\"id\":\"5605\"}},\"id\":\"5370\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5601\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5600\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"5356\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5358\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5355\",\"type\":\"PanTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5604\"},\"major_label_policy\":{\"id\":\"5603\"},\"ticker\":{\"id\":\"5353\"}},\"id\":\"5352\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"5359\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"5352\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"5354\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5353\",\"type\":\"CategoricalTicker\"}],\"root_ids\":[\"5340\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"ca25bd9a-642a-4821-bb6c-d68e650ac8de\",\"root_ids\":[\"5340\"],\"roots\":{\"5340\":\"428c250b-99ae-4b84-9429-56c78f9bc540\"}}];\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": "5340" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=['ID', 'trial number'],\n", " color_column='trial number',\n", " width=550,\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 = {\"98b4eb68-a20a-4d99-9399-fb6c4ae70d9c\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5672\"}],\"center\":[{\"id\":\"5675\"},{\"id\":\"5679\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"5676\"}],\"renderers\":[{\"id\":\"5697\"},{\"id\":\"5702\"}],\"title\":{\"id\":\"5936\"},\"toolbar\":{\"id\":\"5687\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"5665\"},\"x_scale\":{\"id\":\"5668\"},\"y_range\":{\"id\":\"5663\"},\"y_scale\":{\"id\":\"5670\"}},\"id\":\"5664\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"5680\"},{\"id\":\"5681\"},{\"id\":\"5682\"},{\"id\":\"5683\"},{\"id\":\"5684\"},{\"id\":\"5685\"}]},\"id\":\"5687\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5685\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5681\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"5686\"}},\"id\":\"5682\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis\":{\"id\":\"5676\"},\"dimension\":1,\"ticker\":null},\"id\":\"5679\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5683\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5684\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"5668\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"5936\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5945\",\"type\":\"Selection\"},{\"attributes\":{\"axis\":{\"id\":\"5672\"},\"ticker\":null},\"id\":\"5675\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"5940\"},\"major_label_policy\":{\"id\":\"5939\"},\"ticker\":{\"id\":\"5673\"}},\"id\":\"5672\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5943\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5944\",\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"5686\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5677\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"5694\"},\"glyph\":{\"id\":\"5695\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5696\"},\"view\":{\"id\":\"5698\"}},\"id\":\"5697\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"start\":0},\"id\":\"5663\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"4D20Y8ElDcDgPbRjwSUNwDWMimLVxArANYyKYtXECsCL2mBh6WMIwIvaYGHpYwjA4Cg3YP0CBsDgKDdg/QIGwDZ3DV8RogPANncNXxGiA8CLxeNdJUEBwIvF410lQQHAwCd0uXLA/b/AJ3S5csD9v2zEILea/vi/bMQgt5r++L8WYc20wjz0vxZhzbTCPPS/gPvzZNX17r+A+/Nk1fXuv9g0TWAlcuW/2DRNYCVy5b9Y3Ey36tzXv1jcTLfq3Ne/ADz9typWs78APP23Klazv6B8nLaqY8w/oHyctqpjzD/Q5U2ympzgP9DlTbKanOA/gKz0tkog6j+ArPS2SiDqP5S5zV390fE/lLnNXf3R8T/oHCFg1ZP2P+gcIWDVk/Y/QIB0Yq1V+z9AgHRirVX7P8rxY7LCCwBAyvFjssILAEB0o42zrmwCQHSjjbOubAJAIFW3tJrNBEAgVbe0ms0EQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADqCAFmZY17P+oIAWZljXs/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD3CAFmZY2LP/cIAWZljYs/kqXAX184oT+SpcBfXzihP7DGgAwMqpQ/sMaADAyqlD9n+KAPj9S5P2f4oA+P1Lk/XPigD4/UuT9c+KAPj9S5P3oZYbw7Rs0/ehlhvDtGzT/3CAFmZY3LP/cIAWZljcs/PtfgYuJi1j8+1+Bi4mLWP50d+VFxtN0/nR35UXG03T8bDZn7mvvbPxsNmfua+9s/0wRp0C8f2z/TBGnQLx/bP3zfEI5NP9c/fN8Qjk0/1z+GGWG8O0bNP4YZYbw7Rs0/cb5Q4aDNwz9xvlDhoM3DPxq2ILY18bI/GrYgtjXxsj8WKsESEv+uPxYqwRIS/64/9wgBZmWNqz/3CAFmZY2rP4ulwF9fOKE/i6XAX184oT8AAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]}},\"selected\":{\"id\":\"5945\"},\"selection_policy\":{\"id\":\"5944\"}},\"id\":\"5694\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5695\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"5940\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5670\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"5694\"}},\"id\":\"5698\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5946\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5700\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"5665\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"4D20Y8ElDcDgPbRjwSUNwDWMimLVxArANYyKYtXECsCL2mBh6WMIwIvaYGHpYwjA4Cg3YP0CBsDgKDdg/QIGwDZ3DV8RogPANncNXxGiA8CLxeNdJUEBwIvF410lQQHAwCd0uXLA/b/AJ3S5csD9v2zEILea/vi/bMQgt5r++L8WYc20wjz0vxZhzbTCPPS/gPvzZNX17r+A+/Nk1fXuv9g0TWAlcuW/2DRNYCVy5b9Y3Ey36tzXv1jcTLfq3Ne/ADz9typWs78APP23Klazv6B8nLaqY8w/oHyctqpjzD/Q5U2ympzgP9DlTbKanOA/gKz0tkog6j+ArPS2SiDqP5S5zV390fE/lLnNXf3R8T/oHCFg1ZP2P+gcIWDVk/Y/QIB0Yq1V+z9AgHRirVX7P8rxY7LCCwBAyvFjssILAEB0o42zrmwCQHSjjbOubAJAIFW3tJrNBEAgVbe0ms0EQCBVt7SazQRA4D20Y8ElDcA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[46]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADqCAFmZY17P+oIAWZljXs/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD3CAFmZY2LP/cIAWZljYs/kqXAX184oT+SpcBfXzihP7DGgAwMqpQ/sMaADAyqlD9n+KAPj9S5P2f4oA+P1Lk/XPigD4/UuT9c+KAPj9S5P3oZYbw7Rs0/ehlhvDtGzT/3CAFmZY3LP/cIAWZljcs/PtfgYuJi1j8+1+Bi4mLWP50d+VFxtN0/nR35UXG03T8bDZn7mvvbPxsNmfua+9s/0wRp0C8f2z/TBGnQLx/bP3zfEI5NP9c/fN8Qjk0/1z+GGWG8O0bNP4YZYbw7Rs0/cb5Q4aDNwz9xvlDhoM3DPxq2ILY18bI/GrYgtjXxsj8WKsESEv+uPxYqwRIS/64/9wgBZmWNqz/3CAFmZY2rP4ulwF9fOKE/i6XAX184oT8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[46]}},\"selected\":{\"id\":\"5947\"},\"selection_policy\":{\"id\":\"5946\"}},\"id\":\"5699\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5947\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"5939\",\"type\":\"AllLabels\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5696\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"5942\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis_label\":\"density\",\"formatter\":{\"id\":\"5943\"},\"major_label_policy\":{\"id\":\"5942\"},\"ticker\":{\"id\":\"5677\"}},\"id\":\"5676\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5701\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"5673\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"5699\"}},\"id\":\"5703\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5680\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"5699\"},\"glyph\":{\"id\":\"5700\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5701\"},\"view\":{\"id\":\"5703\"}},\"id\":\"5702\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"5664\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"98b4eb68-a20a-4d99-9399-fb6c4ae70d9c\",\"root_ids\":[\"5664\"],\"roots\":{\"5664\":\"64957164-46de-4bb3-b4ff-8ba8c48d6f02\"}}];\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": "5664" } }, "output_type": "display_data" } ], "source": [ "# Plot the histogram\n", "p = iqplot.histogram(x, density=True, rug=False)\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 = {\"7d341775-a44d-40b8-8fc2-e46b942faaf5\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"6023\"}],\"center\":[{\"id\":\"6026\"},{\"id\":\"6030\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"6027\"}],\"renderers\":[{\"id\":\"6051\"},{\"id\":\"6057\"},{\"id\":\"6063\"},{\"id\":\"6069\"}],\"right\":[{\"id\":\"6071\"}],\"title\":{\"id\":\"6321\"},\"toolbar\":{\"id\":\"6038\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"6015\"},\"x_scale\":{\"id\":\"6019\"},\"y_range\":{\"id\":\"6017\"},\"y_scale\":{\"id\":\"6021\"}},\"id\":\"6014\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"6065\"}},\"id\":\"6070\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"6047\"}},\"id\":\"6052\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6067\",\"type\":\"Circle\"},{\"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\",\"order\":\"little\",\"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],\"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],\"trial number\":[2,3,4,1,2,3,1,1,2,3,4,1,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"6336\"},\"selection_policy\":{\"id\":\"6335\"}},\"id\":\"6065\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"6032\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis\":{\"id\":\"6023\"},\"ticker\":null},\"id\":\"6026\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6061\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6321\",\"type\":\"Title\"},{\"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\":\"6068\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"6059\"},\"glyph\":{\"id\":\"6061\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6062\"},\"view\":{\"id\":\"6064\"}},\"id\":\"6063\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6055\",\"type\":\"Circle\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"6051\"}]},\"id\":\"6072\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"6024\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"6331\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"6021\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"6328\"},\"major_label_policy\":{\"id\":\"6327\"},\"ticker\":{\"id\":\"6028\"}},\"id\":\"6027\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"6027\"},\"dimension\":1,\"ticker\":null},\"id\":\"6030\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"6332\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"6028\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"6053\"}},\"id\":\"6058\",\"type\":\"CDSView\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"6072\"},{\"id\":\"6073\"},{\"id\":\"6074\"},{\"id\":\"6075\"}],\"location\":\"center\"},\"id\":\"6071\",\"type\":\"Legend\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"6031\"},{\"id\":\"6032\"},{\"id\":\"6033\"},{\"id\":\"6034\"},{\"id\":\"6035\"},{\"id\":\"6036\"},{\"id\":\"6045\"}]},\"id\":\"6038\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"6324\",\"type\":\"AllLabels\"},{\"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\":\"6056\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6325\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"6036\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"6031\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"6019\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"6037\"}},\"id\":\"6033\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"6034\",\"type\":\"SaveTool\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"6063\"}]},\"id\":\"6074\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"6035\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"trial\",\"@{trial number}\"],[\"adh force\",\"@{adhesive force (mN)}\"]]},\"id\":\"6045\",\"type\":\"HoverTool\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"6325\"},\"major_label_policy\":{\"id\":\"6324\"},\"ticker\":{\"id\":\"6024\"}},\"id\":\"6023\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"6017\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"6015\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"6328\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"6069\"}]},\"id\":\"6075\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"6335\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"6333\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"6057\"}]},\"id\":\"6073\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"6334\",\"type\":\"Selection\"},{\"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\":\"6050\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"6336\",\"type\":\"Selection\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"6049\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"6053\"},\"glyph\":{\"id\":\"6055\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6056\"},\"view\":{\"id\":\"6058\"}},\"id\":\"6057\",\"type\":\"GlyphRenderer\"},{\"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,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"6037\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"6059\"}},\"id\":\"6064\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"6329\",\"type\":\"UnionRenderers\"},{\"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\":\"6062\",\"type\":\"Circle\"},{\"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\",\"order\":\"little\",\"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],\"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],\"trial number\":[1,2,3,1,2,3,1,2,1,2,3,4,1,2,3,4,1,2,3,4]},\"selected\":{\"id\":\"6334\"},\"selection_policy\":{\"id\":\"6333\"}},\"id\":\"6059\",\"type\":\"ColumnDataSource\"},{\"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\",\"order\":\"little\",\"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],\"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],\"trial number\":[1,2,3,4,1,2,3,4,1,2,3,4,1,2,1,2,1,2,3,1]},\"selected\":{\"id\":\"6332\"},\"selection_policy\":{\"id\":\"6331\"}},\"id\":\"6053\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"6047\"},\"glyph\":{\"id\":\"6049\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6050\"},\"view\":{\"id\":\"6052\"}},\"id\":\"6051\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"6065\"},\"glyph\":{\"id\":\"6067\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6068\"},\"view\":{\"id\":\"6070\"}},\"id\":\"6069\",\"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\"],\"__ECDF\":{\"__ndarray__\":\"zczMzMzM6D+amZmZmZnvPzMzMzMzM+0/AAAAAAAA7D+amZmZmZnVPzMzMzMzM+8/mpmZmZmZ3T9mZmZmZmbuPwAAAAAAAPA/AAAAAAAA7j+amZmZmZntP5qZmZmZmes/AAAAAAAA6j/NzMzMzMzsPzMzMzMzM+s/mpmZmZmZ6T9mZmZmZmbmP83MzMzMzO4/MzMzMzMz6T8AAAAAAADUPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"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],\"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],\"trial number\":[3,4,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5]},\"selected\":{\"id\":\"6330\"},\"selection_policy\":{\"id\":\"6329\"}},\"id\":\"6047\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"6330\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"6327\",\"type\":\"AllLabels\"}],\"root_ids\":[\"6014\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n", " var render_items = [{\"docid\":\"7d341775-a44d-40b8-8fc2-e46b942faaf5\",\"root_ids\":[\"6014\"],\"roots\":{\"6014\":\"398e1f89-d874-4003-aaf3-dd99c33e95ea\"}}];\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": "6014" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q=\"impact force (mN)\",\n", " cats=\"ID\",\n", " kind='colored',\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": [ "## 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": { "tags": [ "hide-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Python implementation: CPython\n", "Python version : 3.8.10\n", "IPython version : 7.22.0\n", "\n", "numpy : 1.20.2\n", "pandas : 1.2.4\n", "bokeh : 2.3.2\n", "iqplot : 0.2.3\n", "jupyterlab: 3.0.14\n", "\n" ] } ], "source": [ "%load_ext watermark\n", "%watermark -v -p numpy,pandas,bokeh,iqplot,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.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }