{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise 6.3: Automating scatter plots\n", "\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "We will soon use HoloViews to quickly make scatter plots. Nonetheless, I think coding up your own function to make scatter plots with coloring based on a column of a tidy data frame will help you understand how high level plotting works (and also allow you to practice manipulating data frames).\n", "\n", "**a)** Write a function that takes as input a tidy data frame and generates a scatter plot based on two columns of the data frame and colors the glyphs according to a third column that contains categorical variables. The minimal (you can add other kwargs if you want) call signature should be\n", "\n", "```python\n", "scatter(data, cat, x, y)\n", "```\n", "\n", "**b)** Test out your function by using it to make a scatter plot of the adhesive force versus impact force from the frog tongue strike data set where you color the glyphs by the frog ID." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Solution\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

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

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1001\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.1.1.min.js\": \"kLr4fYcqcSpbuI95brIH3vnnYCquzzSxHPU6XGQCIkQRGJwhg0StNbj1eegrHs12\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.1.1.min.js\": \"xIGPmVtaOm+z0BqfSOMn4lOR6ciex448GIKG4eE61LsAvmGj48XcMQZtKcE/UXZe\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.1.1.min.js\": \"Dc9u1wF/0zApGIWoBbH77iWEHtdmkuYWG839Uzmv8y8yBLXebjO9ZnERsde5Ln/P\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.1.1.min.js\": \"cT9JaBz7GiRXdENrJLZNSC6eMNF3nh3fa5fTF51Svp+ukxPdwcU5kGXGPBgDCa2j\"};\n\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.1.1.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd\n", "\n", "import bokeh_catplot\n", "import colorcet\n", "\n", "import bokeh.io\n", "import bokeh.plotting\n", "\n", "bokeh.io.output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**a)** I will offer some more kwargs, as described in the doc string below. I will demonstrate the use of this function in the next problem." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def scatter(\n", " data=None,\n", " cat=None,\n", " x=None,\n", " y=None,\n", " p=None,\n", " palette=None,\n", " show_legend=True,\n", " click_policy=\"hide\",\n", " marker_kwargs={},\n", " **kwargs,\n", "):\n", " \"\"\"\n", " Parameters\n", " ----------\n", " df : Pandas DataFrame\n", " DataFrame containing tidy data for plotting.\n", " cat : hashable\n", " Name of column to use as categorical variable.\n", " x : hashable\n", " Name of column to use as x-axis.\n", " y : hashable\n", " Name of column to use as y-axis.\n", " p : bokeh.plotting.Figure instance, or None (default)\n", " If None, create a new figure. Otherwise, populate the existing\n", " figure `p`.\n", " palette : list of strings of hex colors, or single hex string\n", " If a list, color palette to use. If a single string representing\n", " a hex color, all glyphs are colored with that color. Default is\n", " the Glasbey Catagory 10.\n", " show_legend : bool, default False\n", " If True, show legend.\n", " tooltips : list of 2-tuples\n", " Specification for tooltips as per Bokeh specifications. For\n", " example, if we want `col1` and `col2` tooltips, we can use\n", " `tooltips=[('label 1': '@col1'), ('label 2': '@col2')]`. Ignored\n", " if `formal` is True.\n", " show_legend : bool, default False\n", " If True, show a legend.\n", " click_policy : str, default \"hide\"\n", " How to display points when their legend entry is clicked.\n", " marker_kwargs : dict\n", " kwargs to be passed to `p.circle()` when making the scatter plot.\n", " kwargs\n", " Any kwargs to be passed to `bokeh.plotting.figure()` when making \n", " the plot.\n", "\n", " Returns\n", " -------\n", " output : bokeh.plotting.Figure instance\n", " Plot populated with jitter plot or box plot.\n", " \"\"\"\n", " # Automatically name the axes\n", " if \"x_axis_label\" not in kwargs:\n", " kwargs[\"x_axis_label\"] = x\n", " if \"y_axis_label\" not in kwargs:\n", " kwargs[\"y_axis_label\"] = y\n", "\n", " # Default palette\n", " if palette is None:\n", " palette = colorcet.b_glasbey_category10\n", " elif type(palette) == str:\n", " palette = [palette]\n", "\n", " # Instantiate figure\n", " if p is None:\n", " p = bokeh.plotting.figure(**kwargs)\n", "\n", " # Build plot (not using color factors) to enable click policies\n", " for i, (name, g) in enumerate(data.groupby(cat, sort=False)):\n", " marker_kwargs[\"color\"] = palette[i % len(palette)]\n", " marker_kwargs[\"legend_label\"] = str(name)\n", " p.circle(source=g, x=x, y=y, **marker_kwargs)\n", "\n", " if show_legend:\n", " p.legend.click_policy = click_policy\n", " else:\n", " p.legend.visible = False\n", "\n", " return p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**b)** We will test this function out on the frog tongue adhesion data, coloring by frog ID." ] }, { "cell_type": "code", "execution_count": 3, "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 = {\"85418d1b-ac54-4665-a354-19786f7ea913\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1011\"}],\"center\":[{\"id\":\"1014\"},{\"id\":\"1018\"},{\"id\":\"1048\"}],\"frame_height\":350,\"frame_width\":450,\"left\":[{\"id\":\"1015\"}],\"renderers\":[{\"id\":\"1037\"},{\"id\":\"1054\"},{\"id\":\"1072\"},{\"id\":\"1092\"}],\"title\":{\"id\":\"1039\"},\"toolbar\":{\"id\":\"1026\"},\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1007\"},\"y_range\":{\"id\":\"1005\"},\"y_scale\":{\"id\":\"1009\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1064\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"WheelZoomTool\"},{\"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\",\"top_units\":\"screen\"},\"id\":\"1025\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"1025\"}},\"id\":\"1021\",\"type\":\"BoxZoomTool\"},{\"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\":\"adhesive force (mN)\"}},\"id\":\"1053\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"dimension\":1,\"ticker\":null},\"id\":\"1018\",\"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\"],\"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+q8dJNYhCovxFYObTIdr6/KVyPwvUovL9aZDvfT42Xvzq0yHa+n6q/YxBYObTItr97FK5H4XrEvyGwcmiR7cy/TDeJQWDloL+HFtnO91PDvxgEVg4tss2/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\":\"1106\"},\"selection_policy\":{\"id\":\"1107\"}},\"id\":\"1088\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1107\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1050\"},\"glyph\":{\"id\":\"1052\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1053\"},\"selection_glyph\":null,\"view\":{\"id\":\"1055\"}},\"id\":\"1054\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"I\"},\"renderers\":[{\"id\":\"1037\"}]},\"id\":\"1049\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis_label\":\"impact force (mN)\",\"formatter\":{\"id\":\"1041\"},\"ticker\":{\"id\":\"1012\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"adhesive force (mN)\"}},\"id\":\"1070\",\"type\":\"Circle\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"adhesive force (mN)\"}},\"id\":\"1052\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"ResetTool\"},{\"attributes\":{\"label\":{\"value\":\"IV\"},\"renderers\":[{\"id\":\"1092\"}]},\"id\":\"1109\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"1088\"},\"glyph\":{\"id\":\"1090\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1091\"},\"selection_glyph\":null,\"view\":{\"id\":\"1093\"}},\"id\":\"1092\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1088\"}},\"id\":\"1093\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1050\"}},\"id\":\"1055\",\"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\":\"adhesive force (mN)\"}},\"id\":\"1091\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1106\",\"type\":\"Selection\"},{\"attributes\":{\"axis\":{\"id\":\"1011\"},\"ticker\":null},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1041\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"II\"},\"renderers\":[{\"id\":\"1054\"}]},\"id\":\"1067\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\"},\"glyph\":{\"id\":\"1035\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1036\"},\"selection_glyph\":null,\"view\":{\"id\":\"1038\"}},\"id\":\"1037\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1085\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"III\"},\"renderers\":[{\"id\":\"1072\"}]},\"id\":\"1087\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1045\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1068\"},\"glyph\":{\"id\":\"1070\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1071\"},\"selection_glyph\":null,\"view\":{\"id\":\"1073\"}},\"id\":\"1072\",\"type\":\"GlyphRenderer\"},{\"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\":\"adhesive force (mN)\"}},\"id\":\"1036\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"1068\"}},\"id\":\"1073\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"1033\"}},\"id\":\"1038\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"ID\":[\"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/PN9PjZduor/jpZvEILCyvylcj8L1KKy/76fGSzeJwb+hRbbz/dTIvxsv3SQGgaW/BoGVQ4tsx7+cxCCwcmihvxgEVg4tsp2/yqFFtvP9tL+F61G4HoXLv+xRuB6F68G/aZHtfD81vr86tMh2vp/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\":\"1084\"},\"selection_policy\":{\"id\":\"1085\"}},\"id\":\"1068\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1084\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1039\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"adhesive force (mN)\",\"formatter\":{\"id\":\"1043\"},\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1043\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1046\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1049\"},{\"id\":\"1067\"},{\"id\":\"1087\"},{\"id\":\"1109\"}]},\"id\":\"1048\",\"type\":\"Legend\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1021\"},{\"id\":\"1022\"},{\"id\":\"1023\"},{\"id\":\"1024\"}]},\"id\":\"1026\",\"type\":\"Toolbar\"},{\"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\":\"adhesive force (mN)\"}},\"id\":\"1071\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1065\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"adhesive force (mN)\"}},\"id\":\"1035\",\"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\"],\"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/azvdT46Xbv1pkO99Pjae/5dAi2/l+2r+TGARWDi2yv/yp8dJNYoC/Gy/dJAaBtb+Nl24Sg8DKvylcj8L1KKy/OrTIdr6fmr+F61G4HoXLv2mR7Xw/Nb6/IbByaJHtzL82XrpJDALLv6RwPQrXo9C/yqFFtvP91L9g5dAi2/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\":\"1064\"},\"selection_policy\":{\"id\":\"1065\"}},\"id\":\"1050\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"impact force (mN)\"},\"y\":{\"field\":\"adhesive force (mN)\"}},\"id\":\"1090\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"ID\":[\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\",\"I\"],\"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__\":\"j8L1KFyP0r9fukkMAivHv39qvHSTGMS/w/UoXI/Cxb/fT42XbhLbv7tJDAIrh8a/PQrXo3A90r89CtejcD3Sv2Q730+Nl86/yqFFtvP91L9SuB6F61HYv99PjZduEtO/+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\":\"1045\"},\"selection_policy\":{\"id\":\"1046\"}},\"id\":\"1033\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1003\",\"type\":\"DataRange1d\"}],\"root_ids\":[\"1002\"]},\"title\":\"Bokeh Application\",\"version\":\"2.1.1\"}};\n", " var render_items = [{\"docid\":\"85418d1b-ac54-4665-a354-19786f7ea913\",\"root_ids\":[\"1002\"],\"roots\":{\"1002\":\"4825b6f2-4086-4e4a-80d9-8d127f42fa1f\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1002" } }, "output_type": "display_data" } ], "source": [ "df = pd.read_csv('data/frog_tongue_adhesion.csv', comment='#')\n", "\n", "p = scatter(\n", " data=df,\n", " cat='ID',\n", " x='impact force (mN)',\n", " y='adhesive force (mN)',\n", " frame_height=350,\n", " frame_width=450\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Looks good!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing environment" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPython 3.7.7\n", "IPython 7.16.1\n", "\n", "pandas 0.24.2\n", "bokeh 2.1.1\n", "bokeh_catplot 0.1.8\n", "jupyterlab 2.1.5\n" ] } ], "source": [ "%load_ext watermark\n", "%watermark -v -p pandas,bokeh,bokeh_catplot,jupyterlab" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.7" } }, "nbformat": 4, "nbformat_minor": 4 }