{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# iqplot\n", "\n", "[Data set download](https://s3.amazonaws.com/bebi103.caltech.edu/data/gfmt_sleep.csv)\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.2.1.min.js\": \"qkRvDQVAIfzsJo40iRBbxt6sttt0hv4lh74DG7OK4MCHv4C5oohXYoHUM5W11uqS\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js\": \"Sb7Mr06a9TNlet/GEBeKaf5xH3eb6AlCzwjtU82wNPyDrnfoiVl26qnvlKjmcAd+\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.1.min.js\": \"HaJ15vgfmcfRtB4c4YBOI4f1MUujukqInOWVqZJZZGK7Q+ivud0OKGSTn/Vm2iso\"};\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.2.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.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.2.1.min.js\": \"qkRvDQVAIfzsJo40iRBbxt6sttt0hv4lh74DG7OK4MCHv4C5oohXYoHUM5W11uqS\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js\": \"Sb7Mr06a9TNlet/GEBeKaf5xH3eb6AlCzwjtU82wNPyDrnfoiVl26qnvlKjmcAd+\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.1.min.js\": \"HaJ15vgfmcfRtB4c4YBOI4f1MUujukqInOWVqZJZZGK7Q+ivud0OKGSTn/Vm2iso\"};\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.2.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.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": [ "# Colab setup ------------------\n", "import os, sys, subprocess\n", "if \"google.colab\" in sys.modules:\n", " cmd = \"pip install --upgrade iqplot colorcet watermark\"\n", " process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n", " stdout, stderr = process.communicate()\n", " data_path = \"https://s3.amazonaws.com/bebi103.caltech.edu/data/\"\n", "else:\n", " data_path = \"../data/\"\n", "# ------------------------------\n", "\n", "import pandas as pd\n", "\n", "import iqplot\n", "\n", "import bokeh.io\n", "bokeh.io.output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "Holoviews is and excellent for this purpose high-level package, but as we have mentioned before, it lacks two key functionalities.\n", "\n", "1. It does not natively conveniently make ECDFs, but [it will soon](https://github.com/pyviz/holoviews/issues/3821).\n", "2. It does not allow for nested categorical axes for plots other than box plots, bar graphs, and violin plots, but [it will soon](http://holoviews.org/user_guide/Customizing_Plots.html#Categorical-axes).\n", "\n", "To address these and other needs, I developed [iq](https://iqplot.github.io/), which generates Bokeh plots for data sets where one variable is quantitative and all other variables of interest, if any, are categorical. This is where the name comes from; the first two letters of the package name are meant to indicate one (Roman number I) quantitative (Q) variable. The subclass of data sets that contain a single quantitative variable (and possibly several categorical variables) abound in the biological sciences.\n", "\n", "There are five 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*.\n", "\n", "- **Plots with a categorical axis**\n", " + Box plots: `iqplot.box()`\n", " + Strip plots: `iqplot.strip()`\n", " + Strip-box plots (strip and box plots overlaid): `iqplot.stripbox()`\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\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", "If `data` is given as a Numpy array, it is the only required argument. `If` data is given as a Pandas DataFrame, `q` must also be supplied. All other arguments are optional and have reasonably set defaults. Any extra kwargs not in the function call signature are passed to `bokeh.plotting.figure()` when the figure is instantiated.\n", "\n", "With this in mind, we will put iqplot to use on facial identification data set to demonstrate how we can make each of the five kinds of plots." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "fname = os.path.join(data_path, \"gfmt_sleep.csv\")\n", "df = pd.read_csv(fname, na_values=\"*\")\n", "df[\"insomnia\"] = df[\"sci\"] <= 16\n", "df[\"sleeper\"] = df[\"insomnia\"].apply(lambda x: \"insomniac\" if x else \"normal\")\n", "df[\"gender\"] = df[\"gender\"].apply(lambda x: \"female\" if x == \"f\" else \"male\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## All four plots\n", "\n", "We now make plots of the percent correct for male and female insomniacs and normal sleepers so you can see how the syntax works." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Box plot" ] }, { "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 = {\"6dd61f42-423b-484d-bdd0-6be9daa1d821\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1011\"}],\"center\":[{\"id\":\"1014\"},{\"id\":\"1017\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1015\"}],\"renderers\":[{\"id\":\"1040\"},{\"id\":\"1045\"},{\"id\":\"1050\"},{\"id\":\"1055\"},{\"id\":\"1060\"}],\"title\":{\"id\":\"1063\"},\"toolbar\":{\"id\":\"1025\"},\"x_range\":{\"id\":\"1004\"},\"x_scale\":{\"id\":\"1007\"},\"y_range\":{\"id\":\"1002\"},\"y_scale\":{\"id\":\"1009\"}},\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\"},\"glyph\":{\"id\":\"1058\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1059\"},\"selection_glyph\":null,\"view\":{\"id\":\"1061\"}},\"id\":\"1060\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1032\"}},\"id\":\"1056\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1032\"},\"glyph\":{\"id\":\"1053\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1054\"},\"selection_glyph\":null,\"view\":{\"id\":\"1056\"}},\"id\":\"1055\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1033\"}},\"id\":\"1061\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1018\",\"type\":\"PanTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1034\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1035\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1059\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1067\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1017\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"SaveTool\"},{\"attributes\":{\"source\":{\"id\":\"1032\"}},\"id\":\"1041\",\"type\":\"CDSView\"},{\"attributes\":{\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1043\",\"type\":\"Segment\"},{\"attributes\":{\"data\":{\"__label\":[\"male, normal\",\"male, normal\"],\"cat\":[[\"male\",\"normal\"],[\"male\",\"normal\"]],\"gender\":[\"male\",\"male\"],\"percent correct\":[57.5,40.0],\"sleeper\":[\"normal\",\"normal\"]},\"selected\":{\"id\":\"1071\"},\"selection_policy\":{\"id\":\"1072\"}},\"id\":\"1033\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"female, normal\",\"male, insomniac\",\"male, normal\"],\"bottom\":[67.5,75.0,76.875,77.5],\"bottom_whisker\":[45.0,55.0,67.5,67.5],\"cat\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"middle\":[72.5,85.0,83.75,82.5],\"top\":[83.75,88.75,88.75,89.375],\"top_whisker\":[95.0,100.0,97.5,95.0]},\"selected\":{\"id\":\"1069\"},\"selection_policy\":{\"id\":\"1070\"}},\"id\":\"1032\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1035\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1067\"},\"ticker\":{\"id\":\"1012\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1069\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"1065\"},\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1070\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1036\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1048\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1032\"},\"glyph\":{\"id\":\"1048\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1049\"},\"selection_glyph\":null,\"view\":{\"id\":\"1051\"}},\"id\":\"1050\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"1024\"}},\"id\":\"1020\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"source\":{\"id\":\"1032\"}},\"id\":\"1046\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data_source\":{\"id\":\"1032\"},\"glyph\":{\"id\":\"1038\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1039\"},\"selection_glyph\":null,\"view\":{\"id\":\"1041\"}},\"id\":\"1040\",\"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\",\"top_units\":\"screen\"},\"id\":\"1024\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"1011\"},\"ticker\":null},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1071\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1072\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1004\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1032\"},\"glyph\":{\"id\":\"1043\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1044\"},\"selection_glyph\":null,\"view\":{\"id\":\"1046\"}},\"id\":\"1045\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1038\",\"type\":\"Segment\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1034\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1035\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1058\",\"type\":\"Circle\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1018\"},{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1021\"},{\"id\":\"1022\"},{\"id\":\"1023\"}]},\"id\":\"1025\",\"type\":\"Toolbar\"},{\"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\":\"1054\",\"type\":\"HBar\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1034\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1036\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1049\",\"type\":\"HBar\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1036\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"source\":{\"id\":\"1032\"}},\"id\":\"1051\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1053\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1065\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1039\",\"type\":\"Segment\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1044\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1063\",\"type\":\"Title\"},{\"attributes\":{\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"1002\",\"type\":\"FactorRange\"}],\"root_ids\":[\"1003\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"6dd61f42-423b-484d-bdd0-6be9daa1d821\",\"root_ids\":[\"1003\"],\"roots\":{\"1003\":\"a6c829a2-8559-4122-83c2-f66179ce718e\"}}];\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 = iqplot.box(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Strip plot\n", "\n", "For this plot, I will add jitter, which is passes as a Boolean. Note that HoloViews cannot make a plot like this because it cannot have nested categorical axes for `Scatter` elements. " ] }, { "cell_type": "code", "execution_count": 4, "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 = {\"91978ef4-7beb-4808-9782-f9c25828ec97\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1137\"}],\"center\":[{\"id\":\"1140\"},{\"id\":\"1143\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1141\"}],\"renderers\":[{\"id\":\"1164\"}],\"title\":{\"id\":\"1178\"},\"toolbar\":{\"id\":\"1151\"},\"x_range\":{\"id\":\"1130\"},\"x_scale\":{\"id\":\"1133\"},\"y_range\":{\"id\":\"1128\"},\"y_scale\":{\"id\":\"1135\"}},\"id\":\"1129\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"axis\":{\"id\":\"1137\"},\"ticker\":null},\"id\":\"1140\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1149\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis\":{\"id\":\"1141\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1143\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1158\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1158\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"1160\"}}},\"id\":\"1163\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\"],\"cat\":[[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"]],\"gender\":[\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"male\",\"female\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"percent correct\":[72.5,90.0,92.5,87.5,62.5,50.0,82.5,67.5,90.0,75.0,62.5,95.0,80.0,80.0,65.0,70.0,70.0,80.0,85.0,75.0,70.0,97.5,87.5,45.0,70.0,72.5,85.0,75.0,67.5,95.0,87.5,92.5,90.0,100.0,70.0,85.0,77.5,92.5,85.0,57.5,92.5,65.0,95.0,77.5,80.0,90.0,80.0,87.5,92.5,75.0,67.5,77.5,72.5,72.5,85.0,87.5,87.5,90.0,87.5,80.0,90.0,80.0,85.0,85.0,77.5,85.0,85.0,85.0,77.5,90.0,100.0,85.0,87.5,97.5,92.5,100.0,60.0,95.0,77.5,77.5,82.5,40.0,87.5,85.0,87.5,77.5,62.5,72.5,85.0,92.5,85.0,72.5,90.0,90.0,55.0,87.5,60.0,77.5,87.5,75.0,70.0,62.5],\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"1184\"},\"selection_policy\":{\"id\":\"1185\"}},\"id\":\"1159\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1184\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1133\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1142\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"source\":{\"id\":\"1159\"}},\"id\":\"1165\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1185\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1145\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1144\"},{\"id\":\"1145\"},{\"id\":\"1146\"},{\"id\":\"1147\"},{\"id\":\"1148\"},{\"id\":\"1149\"}]},\"id\":\"1151\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1144\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1150\"}},\"id\":\"1146\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1130\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1147\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1148\",\"type\":\"ResetTool\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"1128\"},\"width\":0.1},\"id\":\"1160\",\"type\":\"Jitter\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1158\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1158\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"1160\"}}},\"id\":\"1162\",\"type\":\"Circle\"},{\"attributes\":{\"formatter\":{\"id\":\"1180\"},\"ticker\":{\"id\":\"1142\"}},\"id\":\"1141\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"1159\"},\"glyph\":{\"id\":\"1162\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1163\"},\"selection_glyph\":null,\"view\":{\"id\":\"1165\"}},\"id\":\"1164\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1135\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1158\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"1138\",\"type\":\"BasicTicker\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1178\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1182\"},\"ticker\":{\"id\":\"1138\"}},\"id\":\"1137\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1182\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"1128\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1180\",\"type\":\"CategoricalTickFormatter\"},{\"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\":\"1150\",\"type\":\"BoxAnnotation\"}],\"root_ids\":[\"1129\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"91978ef4-7beb-4808-9782-f9c25828ec97\",\"root_ids\":[\"1129\"],\"roots\":{\"1129\":\"1e61dee7-249b-4322-8acd-f880274729cd\"}}];\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": "1129" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " jitter=True,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Strip-box plot\n", "\n", "For a strip-box plot, a strip plot and box plot are overlaid with reasonable defaults for the box plot to enable visualization." ] }, { "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 = {\"08500d81-bbf6-4c4b-8325-196b752765b4\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1240\"}],\"center\":[{\"id\":\"1243\"},{\"id\":\"1246\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1244\"}],\"renderers\":[{\"id\":\"1269\"},{\"id\":\"1274\"},{\"id\":\"1279\"},{\"id\":\"1284\"},{\"id\":\"1289\"},{\"id\":\"1294\"},{\"id\":\"1303\"}],\"title\":{\"id\":\"1326\"},\"toolbar\":{\"id\":\"1254\"},\"x_range\":{\"id\":\"1233\"},\"x_scale\":{\"id\":\"1236\"},\"y_range\":{\"id\":\"1231\"},\"y_scale\":{\"id\":\"1238\"}},\"id\":\"1232\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1251\",\"type\":\"ResetTool\"},{\"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\":\"1283\",\"type\":\"HBar\"},{\"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\":\"1277\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1334\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1236\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1268\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1285\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1280\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1326\",\"type\":\"Title\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1267\",\"type\":\"Segment\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1265\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1272\",\"type\":\"Segment\"},{\"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\":\"1282\",\"type\":\"HBar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1265\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1287\",\"type\":\"HBar\"},{\"attributes\":{\"axis\":{\"id\":\"1240\"},\"ticker\":null},\"id\":\"1243\",\"type\":\"Grid\"},{\"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\":\"1253\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"1231\",\"type\":\"FactorRange\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1270\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1272\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1273\"},\"selection_glyph\":null,\"view\":{\"id\":\"1275\"}},\"id\":\"1274\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1252\",\"type\":\"HelpTool\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1290\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"1273\",\"type\":\"Segment\"},{\"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\":\"1278\",\"type\":\"HBar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1297\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1297\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"1299\"}}},\"id\":\"1302\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1335\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1265\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1288\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1330\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1292\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1293\"},\"selection_glyph\":null,\"view\":{\"id\":\"1295\"}},\"id\":\"1294\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1233\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\"],\"cat\":[[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"]],\"gender\":[\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"male\",\"female\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"percent correct\":[72.5,90.0,92.5,87.5,62.5,50.0,82.5,67.5,90.0,75.0,62.5,95.0,80.0,80.0,65.0,70.0,70.0,80.0,85.0,75.0,70.0,97.5,87.5,45.0,70.0,72.5,85.0,75.0,67.5,95.0,87.5,92.5,90.0,100.0,70.0,85.0,77.5,92.5,85.0,57.5,92.5,65.0,95.0,77.5,80.0,90.0,80.0,87.5,92.5,75.0,67.5,77.5,72.5,72.5,85.0,87.5,87.5,90.0,87.5,80.0,90.0,80.0,85.0,85.0,77.5,85.0,85.0,85.0,77.5,90.0,100.0,85.0,87.5,97.5,92.5,100.0,60.0,95.0,77.5,77.5,82.5,40.0,87.5,85.0,87.5,77.5,62.5,72.5,85.0,92.5,85.0,72.5,90.0,90.0,55.0,87.5,60.0,77.5,87.5,75.0,70.0,62.5],\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"1334\"},\"selection_policy\":{\"id\":\"1335\"}},\"id\":\"1298\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"1292\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"1241\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"1298\"},\"glyph\":{\"id\":\"1301\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1302\"},\"selection_glyph\":null,\"view\":{\"id\":\"1304\"}},\"id\":\"1303\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1277\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1278\"},\"selection_glyph\":null,\"view\":{\"id\":\"1280\"}},\"id\":\"1279\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1332\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1287\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1288\"},\"selection_glyph\":null,\"view\":{\"id\":\"1290\"}},\"id\":\"1289\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1238\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"female, normal\",\"male, insomniac\",\"male, normal\"],\"bottom\":[67.5,75.0,76.875,77.5],\"bottom_whisker\":[45.0,55.0,67.5,67.5],\"cat\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"middle\":[72.5,85.0,83.75,82.5],\"top\":[83.75,88.75,88.75,89.375],\"top_whisker\":[95.0,100.0,97.5,95.0]},\"selected\":{\"id\":\"1332\"},\"selection_policy\":{\"id\":\"1333\"}},\"id\":\"1261\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1333\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"formatter\":{\"id\":\"1328\"},\"ticker\":{\"id\":\"1245\"}},\"id\":\"1244\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"1297\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"1328\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1298\"}},\"id\":\"1304\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1330\"},\"ticker\":{\"id\":\"1241\"}},\"id\":\"1240\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1244\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"1246\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1275\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1267\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1268\"},\"selection_glyph\":null,\"view\":{\"id\":\"1270\"}},\"id\":\"1269\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"1231\"},\"width\":0.1},\"id\":\"1299\",\"type\":\"Jitter\"},{\"attributes\":{},\"id\":\"1245\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"source\":{\"id\":\"1261\"}},\"id\":\"1295\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1247\"},{\"id\":\"1248\"},{\"id\":\"1249\"},{\"id\":\"1250\"},{\"id\":\"1251\"},{\"id\":\"1252\"}]},\"id\":\"1254\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1297\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1297\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"1299\"}}},\"id\":\"1301\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"1261\"},\"glyph\":{\"id\":\"1282\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1283\"},\"selection_glyph\":null,\"view\":{\"id\":\"1285\"}},\"id\":\"1284\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1248\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1247\",\"type\":\"PanTool\"},{\"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\":\"1293\",\"type\":\"HBar\"},{\"attributes\":{\"overlay\":{\"id\":\"1253\"}},\"id\":\"1249\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1250\",\"type\":\"SaveTool\"}],\"root_ids\":[\"1232\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"08500d81-bbf6-4c4b-8325-196b752765b4\",\"root_ids\":[\"1232\"],\"roots\":{\"1232\":\"05e45104-11d4-4b8c-a8a3-f19029f40b12\"}}];\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": "1232" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.stripbox(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " jitter=True,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Histogram\n", "\n", "For histograms, the number of bins are automatically chosen using the [Freedman-Diaconis rule](https://en.wikipedia.org/wiki/Freedman–Diaconis_rule)." ] }, { "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 = {\"64fa0f2d-8306-45c7-82ac-928303d907f2\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1400\"}],\"center\":[{\"id\":\"1403\"},{\"id\":\"1407\"},{\"id\":\"1436\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1404\"}],\"renderers\":[{\"id\":\"1425\"},{\"id\":\"1441\"},{\"id\":\"1457\"},{\"id\":\"1476\"},{\"id\":\"1496\"},{\"id\":\"1519\"},{\"id\":\"1543\"},{\"id\":\"1570\"},{\"id\":\"1598\"},{\"id\":\"1603\"},{\"id\":\"1608\"},{\"id\":\"1613\"}],\"title\":{\"id\":\"1428\"},\"toolbar\":{\"id\":\"1415\"},\"x_range\":{\"id\":\"1393\"},\"x_scale\":{\"id\":\"1396\"},\"y_range\":{\"id\":\"1391\"},\"y_scale\":{\"id\":\"1398\"}},\"id\":\"1392\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1670\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAIQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJkAAAAAAAAAmQAAAAAAAADBAAAAAAAAAMEAAAAAAAAAYQAAAAAAAABhAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]}},\"selected\":{\"id\":\"1513\"},\"selection_policy\":{\"id\":\"1514\"}},\"id\":\"1493\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1452\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1517\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"1453\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1669\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1474\",\"type\":\"Patch\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1568\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1454\"},\"glyph\":{\"id\":\"1455\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1456\"},\"selection_glyph\":null,\"view\":{\"id\":\"1458\"}},\"id\":\"1457\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1423\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1439\",\"type\":\"Patch\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"1434\"},\"selection_policy\":{\"id\":\"1435\"}},\"id\":\"1422\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1455\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1473\"}},\"id\":\"1477\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1471\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"1454\"}},\"id\":\"1458\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1456\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"1457\"},{\"id\":\"1476\"}]},\"id\":\"1472\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1430\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1470\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1432\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQAAAAAAAYFhAAAAAAADgUEA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]}},\"selected\":{\"id\":\"1491\"},\"selection_policy\":{\"id\":\"1492\"}},\"id\":\"1473\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1475\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1473\"},\"glyph\":{\"id\":\"1474\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1475\"},\"selection_glyph\":null,\"view\":{\"id\":\"1477\"}},\"id\":\"1476\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1494\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1434\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1491\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1435\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1492\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAIBGQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]}},\"selected\":{\"id\":\"1452\"},\"selection_policy\":{\"id\":\"1453\"}},\"id\":\"1438\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1438\"},\"glyph\":{\"id\":\"1439\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1440\"},\"selection_glyph\":null,\"view\":{\"id\":\"1442\"}},\"id\":\"1441\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1493\"}},\"id\":\"1497\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1440\",\"type\":\"Patch\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1495\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1438\"}},\"id\":\"1442\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1493\"},\"glyph\":{\"id\":\"1494\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1495\"},\"selection_glyph\":null,\"view\":{\"id\":\"1497\"}},\"id\":\"1496\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAgEtA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAIQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJkAAAAAAAAAmQAAAAAAAADBAAAAAAAAAMEAAAAAAAAAYQAAAAAAAABhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]}},\"selected\":{\"id\":\"1538\"},\"selection_policy\":{\"id\":\"1539\"}},\"id\":\"1516\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]}},\"selected\":{\"id\":\"1470\"},\"selection_policy\":{\"id\":\"1471\"}},\"id\":\"1454\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1514\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"1496\"},{\"id\":\"1519\"}]},\"id\":\"1515\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1513\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1600\"},\"glyph\":{\"id\":\"1601\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1602\"},\"selection_glyph\":null,\"view\":{\"id\":\"1604\"}},\"id\":\"1603\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1596\",\"type\":\"MultiLine\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"1425\"},{\"id\":\"1441\"}]},\"id\":\"1437\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"1516\"}},\"id\":\"1520\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1595\"}},\"id\":\"1599\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1540\"},\"glyph\":{\"id\":\"1541\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1542\"},\"selection_glyph\":null,\"view\":{\"id\":\"1544\"}},\"id\":\"1543\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1610\"},\"glyph\":{\"id\":\"1611\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1612\"},\"selection_glyph\":null,\"view\":{\"id\":\"1614\"}},\"id\":\"1613\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1601\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"1595\"},\"glyph\":{\"id\":\"1596\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1597\"},\"selection_glyph\":null,\"view\":{\"id\":\"1599\"}},\"id\":\"1598\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1401\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1597\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"1605\"},\"glyph\":{\"id\":\"1606\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1607\"},\"selection_glyph\":null,\"view\":{\"id\":\"1609\"}},\"id\":\"1608\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#2ba02b\",\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1518\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1516\"},\"glyph\":{\"id\":\"1517\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1518\"},\"selection_glyph\":null,\"view\":{\"id\":\"1520\"}},\"id\":\"1519\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"xs\":[[90.0,90.0],[82.5,82.5],[67.5,67.5],[85.0,85.0],[75.0,75.0],[97.5,97.5]],\"ys\":[[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8]]},\"selected\":{\"id\":\"1671\"},\"selection_policy\":{\"id\":\"1672\"}},\"id\":\"1600\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"xs\":[[72.5,72.5],[85.0,85.0],[75.0,75.0],[67.5,67.5],[95.0,95.0],[87.5,87.5],[92.5,92.5],[100.0,100.0],[70.0,70.0],[85.0,85.0],[92.5,92.5],[65.0,65.0],[80.0,80.0],[90.0,90.0],[87.5,87.5],[75.0,75.0],[77.5,77.5],[72.5,72.5],[87.5,87.5],[87.5,87.5],[90.0,90.0],[87.5,87.5],[90.0,90.0],[80.0,80.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[90.0,90.0],[100.0,100.0],[85.0,85.0],[87.5,87.5],[97.5,97.5],[92.5,92.5],[100.0,100.0],[60.0,60.0],[95.0,95.0],[77.5,77.5],[77.5,77.5],[82.5,82.5],[87.5,87.5],[85.0,85.0],[77.5,77.5],[62.5,62.5],[72.5,72.5],[85.0,85.0],[92.5,92.5],[55.0,55.0],[60.0,60.0],[77.5,77.5],[87.5,87.5],[75.0,75.0],[70.0,70.0],[62.5,62.5]],\"ys\":[[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8]]},\"selected\":{\"id\":\"1673\"},\"selection_policy\":{\"id\":\"1674\"}},\"id\":\"1605\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1600\"}},\"id\":\"1604\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1538\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1602\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"1393\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"xs\":[[90.0,90.0],[85.0,85.0],[77.5,77.5],[92.5,92.5],[57.5,57.5],[95.0,95.0],[77.5,77.5],[80.0,80.0],[92.5,92.5],[67.5,67.5],[72.5,72.5],[85.0,85.0],[80.0,80.0],[77.5,77.5],[77.5,77.5],[40.0,40.0],[87.5,87.5],[85.0,85.0],[72.5,72.5],[90.0,90.0],[90.0,90.0],[87.5,87.5]],\"ys\":[[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8]]},\"selected\":{\"id\":\"1675\"},\"selection_policy\":{\"id\":\"1676\"}},\"id\":\"1610\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1539\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"1400\"},\"ticker\":null},\"id\":\"1403\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1606\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"1398\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1605\"}},\"id\":\"1609\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1607\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"1396\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1432\"},\"ticker\":{\"id\":\"1401\"}},\"id\":\"1400\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1672\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1409\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1611\",\"type\":\"MultiLine\"},{\"attributes\":{\"source\":{\"id\":\"1610\"}},\"id\":\"1614\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"1612\",\"type\":\"MultiLine\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"1430\"},\"ticker\":{\"id\":\"1405\"}},\"id\":\"1404\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1404\"},\"dimension\":1,\"ticker\":null},\"id\":\"1407\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1671\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1405\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0A=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAAGEAAAAAAAAAYQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAgQAAAAAAAACBAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]}},\"selected\":{\"id\":\"1564\"},\"selection_policy\":{\"id\":\"1565\"}},\"id\":\"1540\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"xs\":[[72.5,72.5],[92.5,92.5],[87.5,87.5],[62.5,62.5],[50.0,50.0],[90.0,90.0],[75.0,75.0],[62.5,62.5],[95.0,95.0],[80.0,80.0],[80.0,80.0],[65.0,65.0],[70.0,70.0],[70.0,70.0],[80.0,80.0],[70.0,70.0],[87.5,87.5],[45.0,45.0],[70.0,70.0]],\"ys\":[[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8],[0,0.8]]},\"selected\":{\"id\":\"1669\"},\"selection_policy\":{\"id\":\"1670\"}},\"id\":\"1595\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1413\",\"type\":\"HelpTool\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1541\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1408\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"1567\"}},\"id\":\"1571\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"1414\"}},\"id\":\"1410\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1411\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1424\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1565\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1412\",\"type\":\"ResetTool\"},{\"attributes\":{\"source\":{\"id\":\"1540\"}},\"id\":\"1544\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1542\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1673\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"1543\"},{\"id\":\"1570\"}]},\"id\":\"1566\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1674\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1428\",\"type\":\"Title\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1437\"},{\"id\":\"1472\"},{\"id\":\"1515\"},{\"id\":\"1566\"}],\"location\":\"top_left\"},\"id\":\"1436\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"1422\"},\"glyph\":{\"id\":\"1423\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1424\"},\"selection_glyph\":null,\"view\":{\"id\":\"1426\"}},\"id\":\"1425\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1564\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1675\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1422\"}},\"id\":\"1426\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1676\",\"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\",\"top_units\":\"screen\"},\"id\":\"1414\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAAERA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAAGEAAAAAAAAAYQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAgQAAAAAAAACBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]}},\"selected\":{\"id\":\"1593\"},\"selection_policy\":{\"id\":\"1594\"}},\"id\":\"1567\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#d62628\",\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1569\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1567\"},\"glyph\":{\"id\":\"1568\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1569\"},\"selection_glyph\":null,\"view\":{\"id\":\"1571\"}},\"id\":\"1570\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1593\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1594\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"start\":0},\"id\":\"1391\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1408\"},{\"id\":\"1409\"},{\"id\":\"1410\"},{\"id\":\"1411\"},{\"id\":\"1412\"},{\"id\":\"1413\"}]},\"id\":\"1415\",\"type\":\"Toolbar\"}],\"root_ids\":[\"1392\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"64fa0f2d-8306-45c7-82ac-928303d907f2\",\"root_ids\":[\"1392\"],\"roots\":{\"1392\":\"841cad3d-2a7f-4831-a597-f57a15996d69\"}}];\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": "1392" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.histogram(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", ")\n", "\n", "p.legend.location = 'top_left'\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### ECDF" ] }, { "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 = {\"8f8dd2ae-334f-4161-bd25-63478d68f772\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1841\"}],\"center\":[{\"id\":\"1844\"},{\"id\":\"1848\"},{\"id\":\"1877\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"1845\"}],\"renderers\":[{\"id\":\"1866\"},{\"id\":\"1882\"},{\"id\":\"1898\"},{\"id\":\"1916\"},{\"id\":\"1937\"},{\"id\":\"1959\"},{\"id\":\"1983\"},{\"id\":\"2010\"},{\"id\":\"2038\"},{\"id\":\"2068\"},{\"id\":\"2101\"},{\"id\":\"2135\"}],\"title\":{\"id\":\"1869\"},\"toolbar\":{\"id\":\"1856\"},\"x_range\":{\"id\":\"1833\"},\"x_scale\":{\"id\":\"1837\"},\"y_range\":{\"id\":\"1835\"},\"y_scale\":{\"id\":\"1839\"}},\"id\":\"1832\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2166\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1980\"},\"glyph\":{\"id\":\"1981\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1982\"},\"selection_glyph\":null,\"view\":{\"id\":\"1984\"}},\"id\":\"1983\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2167\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"1954\"},\"selection_policy\":{\"id\":\"1955\"}},\"id\":\"1934\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":67.5},\"y\":{\"value\":0}},\"id\":\"1935\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"1913\"},\"glyph\":{\"id\":\"1914\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1915\"},\"selection_glyph\":null,\"view\":{\"id\":\"1917\"}},\"id\":\"1916\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2033\"},\"selection_policy\":{\"id\":\"2034\"}},\"id\":\"2007\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":45.0},\"y\":{\"value\":0}},\"id\":\"1880\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"1893\"},\"selection_policy\":{\"id\":\"1894\"}},\"id\":\"1879\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1863\"},\"glyph\":{\"id\":\"1864\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1865\"},\"selection_glyph\":null,\"view\":{\"id\":\"1867\"}},\"id\":\"1866\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAAElAAAAAAAAASUAAAAAAAEBPQAAAAAAAQE9AAAAAAABAT0AAAAAAAEBPQAAAAAAAQFBAAAAAAABAUEAAAAAAAIBRQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAAAgUkAAAAAAACBSQAAAAAAAwFJAAAAAAADAUkAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAAgFZAAAAAAACAVkAAAAAAACBXQAAAAAAAIFdAAAAAAADAV0AAAAAAAMBXQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[38]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAor6G8hvKqPyivobyG8qo/KK+hvIbyuj8or6G8hvK6P15DeQ3lNcQ/XkN5DeU1xD8or6G8hvLKPyivobyG8so/eQ3lNZTX0D95DeU1lNfQP15DeQ3lNdQ/XkN5DeU11D9DeQ3lNZTXP0N5DeU1lNc/KK+hvIby2j8or6G8hvLaPw3lNZTXUN4/DeU1lNdQ3j95DeU1lNfgP3kN5TWU1+A/bCivobyG4j9sKK+hvIbiP15DeQ3lNeQ/XkN5DeU15D9RXkN5DeXlP1FeQ3kN5eU/Q3kN5TWU5z9DeQ3lNZTnPzaU11BeQ+k/NpTXUF5D6T8or6G8hvLqPyivobyG8uo/G8prKK+h7D8bymsor6HsPw3lNZTXUO4/DeU1lNdQ7j8AAAAAAADwPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[38]}},\"selected\":{\"id\":\"1875\"},\"selection_policy\":{\"id\":\"1876\"}},\"id\":\"1863\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1864\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1863\"}},\"id\":\"1867\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1865\",\"type\":\"Line\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1878\"},{\"id\":\"1933\"},{\"id\":\"2006\"},{\"id\":\"2097\"}],\"location\":\"top_left\"},\"id\":\"1877\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"1879\"},\"glyph\":{\"id\":\"1880\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1881\"},\"selection_glyph\":null,\"view\":{\"id\":\"1883\"}},\"id\":\"1882\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1869\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1875\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1876\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"1866\"},{\"id\":\"1882\"},{\"id\":\"1898\"}]},\"id\":\"1878\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"1879\"}},\"id\":\"1883\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":45.0},\"y\":{\"value\":0}},\"id\":\"1881\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"1911\"},\"selection_policy\":{\"id\":\"1912\"}},\"id\":\"1895\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1896\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":100.0},\"y\":{\"value\":1}},\"id\":\"2037\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"2035\"},\"glyph\":{\"id\":\"2036\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2037\"},\"selection_glyph\":null,\"view\":{\"id\":\"2039\"}},\"id\":\"2038\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1839\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQAAAAAAAwExAAAAAAADATEAAAAAAAOBQQAAAAAAA4FBAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAAAgUkAAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAAAAVEAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAADAV0AAAAAAAMBXQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABGF1100UWnP0YXXXTRRac/RhdddNFFtz9GF1100UW3P3TRRRdddME/dNFFF110wT9GF1100UXHP0YXXXTRRcc/F1100UUXzT8XXXTRRRfNP3TRRRdddNE/dNFFF1100T9ddNFFF13UP1100UUXXdQ/RhdddNFF1z9GF1100UXXPy+66KKLLto/L7rooosu2j8XXXTRRRfdPxdddNFFF90/AAAAAAAA4D8AAAAAAADgP3TRRRdddOE/dNFFF1104T/poosuuujiP+miiy666OI/XXTRRRdd5D9ddNFFF13kP9FFF1100eU/0UUXXXTR5T9GF1100UXnP0YXXXTRRec/uuiiiy666D+66KKLLrroPy+66KKLLuo/L7rooosu6j+jiy666KLrP6OLLrroous/F1100UUX7T8XXXTRRRftP4wuuuiii+4/jC666KKL7j8AAAAAAADwPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[44]}},\"selected\":{\"id\":\"2095\"},\"selection_policy\":{\"id\":\"2096\"}},\"id\":\"2065\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2035\"}},\"id\":\"2039\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1894\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":97.5},\"y\":{\"value\":1}},\"id\":\"1958\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1893\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2064\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQAAAAAAAAE5AAAAAAAAATkAAAAAAAABOQAAAAAAAAE5AAAAAAABAT0AAAAAAAEBPQAAAAAAAQE9AAAAAAABAT0AAAAAAAEBQQAAAAAAAQFBAAAAAAADgUEAAAAAAAOBQQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAADAUkAAAAAAAMBSQAAAAAAAwFJAAAAAAADAUkAAAAAAAMBSQAAAAAAAwFJAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAABUQAAAAAAAoFRAAAAAAACgVEAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAwFdAAAAAAABgWEAAAAAAAGBYQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[110]},\"y\":{\"__ndarray__\":\"AAAAAAAAAACeEuQpQZ6SP54S5ClBnpI/nhLkKUGeoj+eEuQpQZ6iP+0b1r5h7as/7RvWvmHtqz+eEuQpQZ6yP54S5ClBnrI/RhdddNFFtz9GF1100UW3P+0b1r5h7bs/7RvWvmHtuz9KkKcEeUrAP0qQpwR5SsA/nhLkKUGewj+eEuQpQZ7CP/KUIE8J8sQ/8pQgTwnyxD9GF1100UXHP0YXXXTRRcc/mpmZmZmZyT+amZmZmZnJP+0b1r5h7cs/7RvWvmHtyz9BnhLkKUHOP0GeEuQpQc4/SpCnBHlK0D9KkKcEeUrQP3TRRRdddNE/dNFFF1100T+eEuQpQZ7SP54S5ClBntI/yFOCPCXI0z/IU4I8JcjTP/KUIE8J8tQ/8pQgTwny1D8c1r5h7RvWPxzWvmHtG9Y/RhdddNFF1z9GF1100UXXP3BY+4a1b9g/cFj7hrVv2D+amZmZmZnZP5qZmZmZmdk/w9o3rH3D2j/D2jesfcPaP+0b1r5h7ds/7RvWvmHt2z8XXXTRRRfdPxdddNFFF90/QZ4S5ClB3j9BnhLkKUHeP2vfsPYNa98/a9+w9g1r3z9KkKcEeUrgP0qQpwR5SuA/37D2DWvf4D/fsPYNa9/gP3TRRRdddOE/dNFFF1104T8J8pQgTwniPwnylCBPCeI/nhLkKUGe4j+eEuQpQZ7iPzMzMzMzM+M/MzMzMzMz4z/IU4I8JcjjP8hTgjwlyOM/XXTRRRdd5D9ddNFFF13kP/KUIE8J8uQ/8pQgTwny5D+HtW9Y+4blP4e1b1j7huU/HNa+Ye0b5j8c1r5h7RvmP7H2DWvfsOY/sfYNa9+w5j9GF1100UXnP0YXXXTRRec/2zesfcPa5z/bN6x9w9rnP3BY+4a1b+g/cFj7hrVv6D8FeUqQpwTpPwV5SpCnBOk/mpmZmZmZ6T+amZmZmZnpPy+66KKLLuo/L7rooosu6j/D2jesfcPqP8PaN6x9w+o/WPuGtW9Y6z9Y+4a1b1jrP+0b1r5h7es/7RvWvmHt6z+CPCXIU4LsP4I8JchTguw/F1100UUX7T8XXXTRRRftP6x9w9o3rO0/rH3D2jes7T9BnhLkKUHuP0GeEuQpQe4/1r5h7RvW7j/WvmHtG9buP2vfsPYNa+8/a9+w9g1r7z8AAAAAAADwPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[110]}},\"selected\":{\"id\":\"2004\"},\"selection_policy\":{\"id\":\"2005\"}},\"id\":\"1980\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1833\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1956\"}},\"id\":\"1960\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1956\"},\"glyph\":{\"id\":\"1957\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1958\"},\"selection_glyph\":null,\"view\":{\"id\":\"1960\"}},\"id\":\"1959\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2063\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1979\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1897\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1835\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1873\"},\"ticker\":{\"id\":\"1842\"}},\"id\":\"1841\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1837\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1895\"}},\"id\":\"1899\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1978\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1895\"},\"glyph\":{\"id\":\"1896\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1897\"},\"selection_glyph\":null,\"view\":{\"id\":\"1899\"}},\"id\":\"1898\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1842\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1841\"},\"ticker\":null},\"id\":\"1844\",\"type\":\"Grid\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAwFJAAAAAAADAUkAAAAAAAKBUQAAAAAAAoFRAAAAAAABAVUAAAAAAAEBVQAAAAAAAgFZAAAAAAACAVkAAAAAAAGBYQAAAAAAAYFhA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABVVVVVVVXFP1VVVVVVVcU/VVVVVVVV1T9VVVVVVVXVPwAAAAAAAOA/AAAAAAAA4D9VVVVVVVXlP1VVVVVVVeU/q6qqqqqq6j+rqqqqqqrqPwAAAAAAAPA/\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"1931\"},\"selection_policy\":{\"id\":\"1932\"}},\"id\":\"1913\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2066\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2065\"},\"glyph\":{\"id\":\"2066\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2067\"},\"selection_glyph\":null,\"view\":{\"id\":\"2069\"}},\"id\":\"2068\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1850\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2098\"},\"glyph\":{\"id\":\"2099\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2100\"},\"selection_glyph\":null,\"view\":{\"id\":\"2102\"}},\"id\":\"2101\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1912\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2096\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"1871\"},\"ticker\":{\"id\":\"1846\"}},\"id\":\"1845\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"2065\"}},\"id\":\"2069\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"1845\"},\"dimension\":1,\"ticker\":null},\"id\":\"1848\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2067\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1846\",\"type\":\"BasicTicker\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":40.0},\"y\":{\"value\":0}},\"id\":\"2099\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1981\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1911\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2007\"},\"glyph\":{\"id\":\"2008\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2009\"},\"selection_glyph\":null,\"view\":{\"id\":\"2011\"}},\"id\":\"2010\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"2068\"},{\"id\":\"2101\"},{\"id\":\"2135\"}]},\"id\":\"2097\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1854\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1849\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2005\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"overlay\":{\"id\":\"1855\"}},\"id\":\"1851\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"1980\"}},\"id\":\"1984\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1982\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1852\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2095\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1853\",\"type\":\"ResetTool\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"1983\"},{\"id\":\"2010\"},{\"id\":\"2038\"}]},\"id\":\"2006\",\"type\":\"LegendItem\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":55.0},\"y\":{\"value\":0}},\"id\":\"2008\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1914\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1871\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2130\"},\"selection_policy\":{\"id\":\"2131\"}},\"id\":\"2098\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1934\"},\"glyph\":{\"id\":\"1935\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1936\"},\"selection_glyph\":null,\"view\":{\"id\":\"1938\"}},\"id\":\"1937\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1932\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"1913\"}},\"id\":\"1917\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2004\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1915\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2098\"}},\"id\":\"2102\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"1916\"},{\"id\":\"1937\"},{\"id\":\"1959\"}]},\"id\":\"1933\",\"type\":\"LegendItem\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":40.0},\"y\":{\"value\":0}},\"id\":\"2100\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1873\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"2134\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1931\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"2007\"}},\"id\":\"2011\",\"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\",\"top_units\":\"screen\"},\"id\":\"1855\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":55.0},\"y\":{\"value\":0}},\"id\":\"2009\",\"type\":\"Ray\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2063\"},\"selection_policy\":{\"id\":\"2064\"}},\"id\":\"2035\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2131\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2130\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1934\"}},\"id\":\"1938\",\"type\":\"CDSView\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":67.5},\"y\":{\"value\":0}},\"id\":\"1936\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2033\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"1978\"},\"selection_policy\":{\"id\":\"1979\"}},\"id\":\"1956\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":97.5},\"y\":{\"value\":1}},\"id\":\"1957\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"2133\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"2034\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"2166\"},\"selection_policy\":{\"id\":\"2167\"}},\"id\":\"2132\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1849\"},{\"id\":\"1850\"},{\"id\":\"1851\"},{\"id\":\"1852\"},{\"id\":\"1853\"},{\"id\":\"1854\"}]},\"id\":\"1856\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"2132\"}},\"id\":\"2136\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2132\"},\"glyph\":{\"id\":\"2133\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2134\"},\"selection_glyph\":null,\"view\":{\"id\":\"2136\"}},\"id\":\"2135\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1955\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1954\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":100.0},\"y\":{\"value\":1}},\"id\":\"2036\",\"type\":\"Ray\"}],\"root_ids\":[\"1832\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"8f8dd2ae-334f-4161-bd25-63478d68f772\",\"root_ids\":[\"1832\"],\"roots\":{\"1832\":\"729117c8-f6a3-4a59-b43f-429112771357\"}}];\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": "1832" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " style='staircase'\n", ")\n", "\n", "p.legend.location = 'top_left'\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that the ECDFs show a clear difference. Female insomniacs have a distribution that is shifted leftward from all other categories. This is most revealing in the ECDF." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Customization with iqplot\n", "\n", "You may have noticed in the discussion of ECDFs that I introduced some a new keyword argument, `style='staircase'`. There are plot-type-specific kwargs which enable customization beyond the customization kwargs common to the plot types, such as `palette` and `q_axis`.\n", "\n", "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", "of by reading [the documentation](https://iqplot.github.io/). 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 using the `q_axis` kwarg." ] }, { "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 = {\"84772122-e7b7-415e-90e7-b89e2f2f3449\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2425\"}],\"center\":[{\"id\":\"2427\"},{\"id\":\"2431\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2428\"}],\"renderers\":[{\"id\":\"2454\"},{\"id\":\"2459\"},{\"id\":\"2464\"},{\"id\":\"2469\"},{\"id\":\"2474\"}],\"title\":{\"id\":\"2570\"},\"toolbar\":{\"id\":\"2439\"},\"x_range\":{\"id\":\"2416\"},\"x_scale\":{\"id\":\"2421\"},\"y_range\":{\"id\":\"2419\"},\"y_scale\":{\"id\":\"2423\"}},\"id\":\"2417\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2572\"},\"ticker\":{\"id\":\"2429\"}},\"id\":\"2428\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"2446\"},\"glyph\":{\"id\":\"2457\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2458\"},\"selection_glyph\":null,\"view\":{\"id\":\"2460\"}},\"id\":\"2459\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"2425\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"2427\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"2574\"},\"ticker\":{\"id\":\"2426\"}},\"id\":\"2425\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"source\":{\"id\":\"2446\"}},\"id\":\"2455\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2574\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"2447\"},\"glyph\":{\"id\":\"2472\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2473\"},\"selection_glyph\":null,\"view\":{\"id\":\"2475\"}},\"id\":\"2474\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2457\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"2426\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2429\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2428\"},\"dimension\":1,\"ticker\":null},\"id\":\"2431\",\"type\":\"Grid\"},{\"attributes\":{\"data\":{\"__label\":[\"male, normal\",\"male, normal\"],\"cat\":[[\"male\",\"normal\"],[\"male\",\"normal\"]],\"gender\":[\"male\",\"male\"],\"percent correct\":[57.5,40.0],\"sleeper\":[\"normal\",\"normal\"]},\"selected\":{\"id\":\"2578\"},\"selection_policy\":{\"id\":\"2579\"}},\"id\":\"2447\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2578\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2446\"},\"glyph\":{\"id\":\"2452\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2453\"},\"selection_glyph\":null,\"view\":{\"id\":\"2455\"}},\"id\":\"2454\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2579\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2437\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2432\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2438\"}},\"id\":\"2434\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2435\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2576\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"2447\"}},\"id\":\"2475\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2436\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2421\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2577\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2450\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2463\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"2572\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2448\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2449\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2473\",\"type\":\"Circle\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"2452\",\"type\":\"Segment\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2450\"}},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2462\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"2446\"},\"glyph\":{\"id\":\"2467\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2468\"},\"selection_glyph\":null,\"view\":{\"id\":\"2470\"}},\"id\":\"2469\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2570\",\"type\":\"Title\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"female, normal\",\"male, insomniac\",\"male, normal\"],\"bottom\":[67.5,75.0,76.875,77.5],\"bottom_whisker\":[45.0,55.0,67.5,67.5],\"cat\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"middle\":[72.5,85.0,83.75,82.5],\"top\":[83.75,88.75,88.75,89.375],\"top_whisker\":[95.0,100.0,97.5,95.0]},\"selected\":{\"id\":\"2576\"},\"selection_policy\":{\"id\":\"2577\"}},\"id\":\"2446\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2438\",\"type\":\"BoxAnnotation\"},{\"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\":\"2468\",\"type\":\"VBar\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2467\",\"type\":\"VBar\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"2416\",\"type\":\"FactorRange\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"2453\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"2423\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"2446\"},\"glyph\":{\"id\":\"2462\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2463\"},\"selection_glyph\":null,\"view\":{\"id\":\"2465\"}},\"id\":\"2464\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"2449\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2432\"},{\"id\":\"2433\"},{\"id\":\"2434\"},{\"id\":\"2435\"},{\"id\":\"2436\"},{\"id\":\"2437\"}]},\"id\":\"2439\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"2446\"}},\"id\":\"2460\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"2446\"}},\"id\":\"2465\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"2450\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"source\":{\"id\":\"2446\"}},\"id\":\"2470\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"2448\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"2419\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2448\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2449\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2472\",\"type\":\"Circle\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2458\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"2433\",\"type\":\"WheelZoomTool\"}],\"root_ids\":[\"2417\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"84772122-e7b7-415e-90e7-b89e2f2f3449\",\"root_ids\":[\"2417\"],\"roots\":{\"2417\":\"fc9f451d-e2e2-4b57-ad72-4f2f12b9fba8\"}}];\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": "2417" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.box(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\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": 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 = {\"9f65ba6a-8588-4a1c-ae94-ef13bb2cc28e\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2644\"}],\"center\":[{\"id\":\"2646\"},{\"id\":\"2650\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2647\"}],\"renderers\":[{\"id\":\"2670\"},{\"id\":\"2675\"},{\"id\":\"2680\"},{\"id\":\"2685\"},{\"id\":\"2690\"},{\"id\":\"2695\"},{\"id\":\"2700\"}],\"title\":{\"id\":\"2807\"},\"toolbar\":{\"id\":\"2658\"},\"x_range\":{\"id\":\"2635\"},\"x_scale\":{\"id\":\"2640\"},\"y_range\":{\"id\":\"2638\"},\"y_scale\":{\"id\":\"2642\"}},\"id\":\"2636\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2683\",\"type\":\"VBar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2657\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"2811\"},\"ticker\":{\"id\":\"2645\"}},\"id\":\"2644\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data\":{\"__label\":[\"male, normal\",\"male, normal\"],\"cat\":[[\"male\",\"normal\"],[\"male\",\"normal\"]],\"gender\":[\"male\",\"male\"],\"percent correct\":[57.5,40.0],\"sleeper\":[\"normal\",\"normal\"]},\"selected\":{\"id\":\"2815\"},\"selection_policy\":{\"id\":\"2816\"}},\"id\":\"2666\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis\":{\"id\":\"2644\"},\"grid_line_color\":null,\"ticker\":null},\"id\":\"2646\",\"type\":\"Grid\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"2635\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"2638\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2809\"},\"ticker\":{\"id\":\"2648\"}},\"id\":\"2647\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2640\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2689\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"2666\"},\"glyph\":{\"id\":\"2698\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2699\"},\"selection_glyph\":null,\"view\":{\"id\":\"2701\"}},\"id\":\"2700\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7C0000\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2699\",\"type\":\"Diamond\"},{\"attributes\":{},\"id\":\"2813\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2683\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2684\"},\"selection_glyph\":null,\"view\":{\"id\":\"2686\"}},\"id\":\"2685\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"2668\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2691\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2814\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2673\",\"type\":\"Segment\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":\"#7C0000\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2698\",\"type\":\"Diamond\"},{\"attributes\":{},\"id\":\"2645\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2648\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2647\"},\"dimension\":1,\"ticker\":null},\"id\":\"2650\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2673\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2674\"},\"selection_glyph\":null,\"view\":{\"id\":\"2676\"}},\"id\":\"2675\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"2669\",\"type\":\"Segment\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2651\"},{\"id\":\"2652\"},{\"id\":\"2653\"},{\"id\":\"2654\"},{\"id\":\"2655\"},{\"id\":\"2656\"}]},\"id\":\"2658\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2809\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"2666\"}},\"id\":\"2701\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2815\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2656\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2688\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2689\"},\"selection_glyph\":null,\"view\":{\"id\":\"2691\"}},\"id\":\"2690\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2651\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2816\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"overlay\":{\"id\":\"2657\"}},\"id\":\"2653\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2693\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2694\"},\"selection_glyph\":null,\"view\":{\"id\":\"2696\"}},\"id\":\"2695\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2674\",\"type\":\"Segment\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2694\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"2654\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2655\",\"type\":\"ResetTool\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2688\",\"type\":\"VBar\"},{\"attributes\":{\"bottom\":{\"field\":\"top_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"top_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2679\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2696\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2684\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2681\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom\":{\"field\":\"top_whisker\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"top_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2678\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2671\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2676\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2652\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"female, normal\",\"male, insomniac\",\"male, normal\"],\"bottom\":[67.5,75.0,76.875,77.5],\"bottom_whisker\":[45.0,55.0,67.5,67.5],\"cat\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"middle\":[72.5,85.0,83.75,82.5],\"top\":[83.75,88.75,88.75,89.375],\"top_whisker\":[95.0,100.0,97.5,95.0]},\"selected\":{\"id\":\"2813\"},\"selection_policy\":{\"id\":\"2814\"}},\"id\":\"2665\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2807\",\"type\":\"Title\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2693\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"2642\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"2665\"}},\"id\":\"2686\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2678\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2679\"},\"selection_glyph\":null,\"view\":{\"id\":\"2681\"}},\"id\":\"2680\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2665\"},\"glyph\":{\"id\":\"2668\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2669\"},\"selection_glyph\":null,\"view\":{\"id\":\"2671\"}},\"id\":\"2670\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2811\",\"type\":\"CategoricalTickFormatter\"}],\"root_ids\":[\"2636\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"9f65ba6a-8588-4a1c-ae94-ef13bb2cc28e\",\"root_ids\":[\"2636\"],\"roots\":{\"2636\":\"3cabbe15-e95e-4be2-ac01-f52a6c7196de\"}}];\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": "2636" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.box(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " q_axis='y',\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": [ "### Customzing 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": 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 = {\"05e3d53e-6c33-40f8-ba7d-c121a8c5c2b9\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2881\"}],\"center\":[{\"id\":\"2884\"},{\"id\":\"2887\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"2885\"}],\"renderers\":[{\"id\":\"2907\"}],\"title\":{\"id\":\"3025\"},\"toolbar\":{\"id\":\"2895\"},\"x_range\":{\"id\":\"2874\"},\"x_scale\":{\"id\":\"2877\"},\"y_range\":{\"id\":\"2872\"},\"y_scale\":{\"id\":\"2879\"}},\"id\":\"2873\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"overlay\":{\"id\":\"2894\"}},\"id\":\"2890\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":1.5707963267948966},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2902\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2902\"}},\"size\":{\"units\":\"screen\",\"value\":37.5},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2906\",\"type\":\"Dash\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"2902\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"2892\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2903\"},\"glyph\":{\"id\":\"2905\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2906\"},\"selection_glyph\":null,\"view\":{\"id\":\"2908\"}},\"id\":\"2907\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"2872\",\"type\":\"FactorRange\"},{\"attributes\":{\"source\":{\"id\":\"2903\"}},\"id\":\"2908\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2874\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2888\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"3029\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"2881\"},\"ticker\":null},\"id\":\"2884\",\"type\":\"Grid\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":1.5707963267948966},\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2902\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2902\"}},\"size\":{\"units\":\"screen\",\"value\":37.5},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2905\",\"type\":\"Dash\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\"],\"cat\":[[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"]],\"gender\":[\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"male\",\"female\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"percent correct\":[72.5,90.0,92.5,87.5,62.5,50.0,82.5,67.5,90.0,75.0,62.5,95.0,80.0,80.0,65.0,70.0,70.0,80.0,85.0,75.0,70.0,97.5,87.5,45.0,70.0,72.5,85.0,75.0,67.5,95.0,87.5,92.5,90.0,100.0,70.0,85.0,77.5,92.5,85.0,57.5,92.5,65.0,95.0,77.5,80.0,90.0,80.0,87.5,92.5,75.0,67.5,77.5,72.5,72.5,85.0,87.5,87.5,90.0,87.5,80.0,90.0,80.0,85.0,85.0,77.5,85.0,85.0,85.0,77.5,90.0,100.0,85.0,87.5,97.5,92.5,100.0,60.0,95.0,77.5,77.5,82.5,40.0,87.5,85.0,87.5,77.5,62.5,72.5,85.0,92.5,85.0,72.5,90.0,90.0,55.0,87.5,60.0,77.5,87.5,75.0,70.0,62.5],\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"3031\"},\"selection_policy\":{\"id\":\"3032\"}},\"id\":\"2903\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3029\"},\"ticker\":{\"id\":\"2882\"}},\"id\":\"2881\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"3027\"},\"ticker\":{\"id\":\"2886\"}},\"id\":\"2885\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2886\",\"type\":\"CategoricalTicker\"},{\"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\":\"2894\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"3027\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2879\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2891\",\"type\":\"SaveTool\"},{\"attributes\":{\"axis\":{\"id\":\"2885\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"2887\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2882\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3031\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3032\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2877\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2889\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3025\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2888\"},{\"id\":\"2889\"},{\"id\":\"2890\"},{\"id\":\"2891\"},{\"id\":\"2892\"},{\"id\":\"2893\"}]},\"id\":\"2895\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2893\",\"type\":\"HelpTool\"}],\"root_ids\":[\"2873\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"05e3d53e-6c33-40f8-ba7d-c121a8c5c2b9\",\"root_ids\":[\"2873\"],\"roots\":{\"2873\":\"61bfbc3a-4a6e-4bbd-aa0b-beabb1aea29c\"}}];\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": "2873" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " marker='dash',\n", " marker_kwargs=dict(alpha=0.5)\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I prefer jittering to this, but a strip plot with dashes is an option (also in HoloViews). Below, I add hover tools that give more information about the respective data points in a jittered strip plot." ] }, { "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 = {\"1a8a9283-1e60-4bfa-80b7-6a93d69589ee\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3087\"}],\"center\":[{\"id\":\"3090\"},{\"id\":\"3093\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"3091\"}],\"renderers\":[{\"id\":\"3116\"}],\"title\":{\"id\":\"3243\"},\"toolbar\":{\"id\":\"3101\"},\"x_range\":{\"id\":\"3080\"},\"x_scale\":{\"id\":\"3083\"},\"y_range\":{\"id\":\"3078\"},\"y_scale\":{\"id\":\"3085\"}},\"id\":\"3079\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"3250\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3247\"},\"ticker\":{\"id\":\"3088\"}},\"id\":\"3087\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3092\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis\":{\"id\":\"3091\"},\"dimension\":1,\"grid_line_color\":null,\"ticker\":null},\"id\":\"3093\",\"type\":\"Grid\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"3078\"},\"width\":0.1},\"id\":\"3112\",\"type\":\"Jitter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3094\"},{\"id\":\"3095\"},{\"id\":\"3096\"},{\"id\":\"3097\"},{\"id\":\"3098\"},{\"id\":\"3099\"},{\"id\":\"3108\"}]},\"id\":\"3101\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"3095\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"3094\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"3100\"}},\"id\":\"3096\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"3245\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"3097\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3110\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3110\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"3112\"}}},\"id\":\"3115\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3098\",\"type\":\"ResetTool\"},{\"attributes\":{\"source\":{\"id\":\"3111\"}},\"id\":\"3117\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3243\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"3247\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3083\",\"type\":\"LinearScale\"},{\"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\":\"3100\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"3087\"},\"ticker\":null},\"id\":\"3090\",\"type\":\"Grid\"},{\"attributes\":{\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"3078\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"3099\",\"type\":\"HelpTool\"},{\"attributes\":{\"data\":{\"__label\":[\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"male, insomniac\",\"male, insomniac\",\"female, insomniac\",\"male, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"female, normal\",\"male, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\"],\"age\":[39,42,31,35,74,61,32,62,33,53,41,36,40,24,32,40,61,42,31,28,26,45,28,44,28,42,45,16,21,18,28,38,17,25,22,41,53,43,23,19,45,43,35,24,64,36,35,43,44,29,22,46,35,53,29,31,21,42,23,54,24,21,21,43,50,53,16,67,36,34,42,46,69,31,44,25,45,47,33,18,74,21,45,37,41,41,34,39,18,31,26,66,62,22,41,46,56,23,70,24,40,33],\"cat\":[[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"male\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"male\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"],[\"female\",\"normal\"]],\"gender\":[\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"male\",\"female\",\"male\",\"female\",\"male\",\"female\",\"female\",\"male\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"female\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"male\",\"male\",\"male\",\"male\",\"female\",\"male\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"participant number\":[8,16,18,22,27,28,30,33,34,35,38,41,46,49,55,71,76,77,78,80,89,90,93,100,101,1,2,3,4,5,6,7,9,10,11,12,13,14,15,17,19,20,21,23,24,25,26,29,31,32,36,37,39,40,42,43,44,45,48,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,79,81,82,83,84,85,86,87,88,91,92,94,95,96,97,98,99,102,103],\"percent correct\":[72.5,90.0,92.5,87.5,62.5,50.0,82.5,67.5,90.0,75.0,62.5,95.0,80.0,80.0,65.0,70.0,70.0,80.0,85.0,75.0,70.0,97.5,87.5,45.0,70.0,72.5,85.0,75.0,67.5,95.0,87.5,92.5,90.0,100.0,70.0,85.0,77.5,92.5,85.0,57.5,92.5,65.0,95.0,77.5,80.0,90.0,80.0,87.5,92.5,75.0,67.5,77.5,72.5,72.5,85.0,87.5,87.5,90.0,87.5,80.0,90.0,80.0,85.0,85.0,77.5,85.0,85.0,85.0,77.5,90.0,100.0,85.0,87.5,97.5,92.5,100.0,60.0,95.0,77.5,77.5,82.5,40.0,87.5,85.0,87.5,77.5,62.5,72.5,85.0,92.5,85.0,72.5,90.0,90.0,55.0,87.5,60.0,77.5,87.5,75.0,70.0,62.5],\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"3249\"},\"selection_policy\":{\"id\":\"3250\"}},\"id\":\"3111\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3110\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3110\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"3112\"}}},\"id\":\"3114\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3080\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"3111\"},\"glyph\":{\"id\":\"3114\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3115\"},\"selection_glyph\":null,\"view\":{\"id\":\"3117\"}},\"id\":\"3116\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3088\",\"type\":\"BasicTicker\"},{\"attributes\":{\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]],\"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\":\"3110\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"3249\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"age\",\"@{age}\"],[\"participant number\",\"@{participant number}\"]]},\"id\":\"3108\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"3085\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"formatter\":{\"id\":\"3245\"},\"ticker\":{\"id\":\"3092\"}},\"id\":\"3091\",\"type\":\"CategoricalAxis\"}],\"root_ids\":[\"3079\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"1a8a9283-1e60-4bfa-80b7-6a93d69589ee\",\"root_ids\":[\"3079\"],\"roots\":{\"3079\":\"5b8740f8-b231-48b4-b608-01b38d0d683e\"}}];\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": "3079" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.strip(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " jitter=True,\n", " tooltips=[\n", " ('age', '@{age}'),\n", " ('participant number', '@{participant number}')\n", " ],\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, and we'll make the plot a little wider to support the legend." ] }, { "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 = {\"cc4e9561-0004-4eb1-b452-d2cd1fdc8138\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3305\"}],\"center\":[{\"id\":\"3308\"},{\"id\":\"3312\"},{\"id\":\"3341\"}],\"frame_height\":275,\"frame_width\":525,\"left\":[{\"id\":\"3309\"}],\"renderers\":[{\"id\":\"3330\"},{\"id\":\"3346\"},{\"id\":\"3362\"},{\"id\":\"3381\"},{\"id\":\"3401\"},{\"id\":\"3424\"},{\"id\":\"3448\"},{\"id\":\"3475\"},{\"id\":\"3503\"},{\"id\":\"3508\"},{\"id\":\"3513\"},{\"id\":\"3518\"}],\"title\":{\"id\":\"3333\"},\"toolbar\":{\"id\":\"3320\"},\"x_range\":{\"id\":\"3298\"},\"x_scale\":{\"id\":\"3301\"},\"y_range\":{\"id\":\"3296\"},\"y_scale\":{\"id\":\"3303\"}},\"id\":\"3297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3380\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"3680\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"3378\"},\"glyph\":{\"id\":\"3379\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3380\"},\"selection_glyph\":null,\"view\":{\"id\":\"3382\"}},\"id\":\"3381\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"3378\"}},\"id\":\"3382\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3681\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABfEQgWgWCBP18RCBaBYIE/1MEKyFYrhz/UwQrIViuHP1tyDXos9ow/W3INeiz2jD83cg16LPacPzdyDXos9pw/l8oOU5fbnz+Xyg5Tl9ufP9TBCshWK6c/1MEKyFYrpz9fEQgWgWCRP18RCBaBYJE/AAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]}},\"selected\":{\"id\":\"3418\"},\"selection_policy\":{\"id\":\"3419\"}},\"id\":\"3398\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3396\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3682\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3339\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3397\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3683\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3340\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAIBGQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADtWIEw0o6FP+1YgTDSjoU/7ViBMNKOhT/tWIEw0o6FP7ICYaQdK6A/sgJhpB0roD/tWIEw0o6VP+1YgTDSjpU/KK+hvIbymj8or6G8hvKaPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[14]}},\"selected\":{\"id\":\"3357\"},\"selection_policy\":{\"id\":\"3358\"}},\"id\":\"3343\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3343\"}},\"id\":\"3347\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3399\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"3421\"}},\"id\":\"3425\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3419\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b3\",\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3345\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"3398\"}},\"id\":\"3402\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3343\"},\"glyph\":{\"id\":\"3344\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3345\"},\"selection_glyph\":null,\"view\":{\"id\":\"3347\"}},\"id\":\"3346\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3400\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAARERERERGhPxEREREREaE/ERERERERoT8RERERERGhPxEREREREaE/ERERERERoT8AAAAAAAAAAA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[8]}},\"selected\":{\"id\":\"3375\"},\"selection_policy\":{\"id\":\"3376\"}},\"id\":\"3359\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3445\"}},\"id\":\"3449\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"3401\"},{\"id\":\"3424\"}]},\"id\":\"3420\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"3357\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3418\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3358\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAgEtA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABfEQgWgWCBP18RCBaBYIE/1MEKyFYrhz/UwQrIViuHP1tyDXos9ow/W3INeiz2jD83cg16LPacPzdyDXos9pw/l8oOU5fbnz+Xyg5Tl9ufP9TBCshWK6c/1MEKyFYrpz9fEQgWgWCRP18RCBaBYJE/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]}},\"selected\":{\"id\":\"3443\"},\"selection_policy\":{\"id\":\"3444\"}},\"id\":\"3421\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3447\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#2ba02b\",\"line_alpha\":0.1,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3423\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"3421\"},\"glyph\":{\"id\":\"3422\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3423\"},\"selection_glyph\":null,\"view\":{\"id\":\"3425\"}},\"id\":\"3424\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3360\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQAAAAAAAYFhAAAAAAADgUEA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAARERERERGhPxEREREREaE/ERERERERoT8RERERERGhPxEREREREaE/ERERERERoT8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[10]}},\"selected\":{\"id\":\"3396\"},\"selection_policy\":{\"id\":\"3397\"}},\"id\":\"3378\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3443\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3376\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"3359\"}},\"id\":\"3363\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3361\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3473\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"3444\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"3362\"},{\"id\":\"3381\"}]},\"id\":\"3377\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"3375\",\"type\":\"Selection\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3446\",\"type\":\"Line\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0A=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADMdNxjJLJ3P8x03GMksnc/AAAAAAAAAAAAAAAAAAAAAMx03GMksnc/zHTcYySydz/GdNxjJLJ3P8Z03GMksnc/nlflSpvFoT+eV+VKm8WhP/eR03ytnp0/95HTfK2enT/GdNxjJLKnP8Z03GMksqc/AAAAAAAAAAA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[16]}},\"selected\":{\"id\":\"3469\"},\"selection_policy\":{\"id\":\"3470\"}},\"id\":\"3445\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAAERA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADMdNxjJLJ3P8x03GMksnc/AAAAAAAAAAAAAAAAAAAAAMx03GMksnc/zHTcYySydz/GdNxjJLJ3P8Z03GMksnc/nlflSpvFoT+eV+VKm8WhP/eR03ytnp0/95HTfK2enT/GdNxjJLKnP8Z03GMksqc/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[18]}},\"selected\":{\"id\":\"3498\"},\"selection_policy\":{\"id\":\"3499\"}},\"id\":\"3472\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"3448\"},{\"id\":\"3475\"}]},\"id\":\"3471\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"3314\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"3470\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3313\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"3318\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"3316\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"3317\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"3469\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"3359\"},\"glyph\":{\"id\":\"3360\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3361\"},\"selection_glyph\":null,\"view\":{\"id\":\"3363\"}},\"id\":\"3362\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"3327\"},\"glyph\":{\"id\":\"3328\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3329\"},\"selection_glyph\":null,\"view\":{\"id\":\"3331\"}},\"id\":\"3330\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"density\",\"formatter\":{\"id\":\"3335\"},\"ticker\":{\"id\":\"3310\"}},\"id\":\"3309\",\"type\":\"LinearAxis\"},{\"attributes\":{\"start\":0},\"id\":\"3296\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"xs\":[[72.5,72.5],[92.5,92.5],[87.5,87.5],[62.5,62.5],[50.0,50.0],[90.0,90.0],[75.0,75.0],[62.5,62.5],[95.0,95.0],[80.0,80.0],[80.0,80.0],[65.0,65.0],[70.0,70.0],[70.0,70.0],[80.0,80.0],[70.0,70.0],[87.5,87.5],[45.0,45.0],[70.0,70.0]],\"ys\":[[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583]]},\"selected\":{\"id\":\"3676\"},\"selection_policy\":{\"id\":\"3677\"}},\"id\":\"3500\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3422\",\"type\":\"Patch\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADtWIEw0o6FP+1YgTDSjoU/7ViBMNKOhT/tWIEw0o6FP7ICYaQdK6A/sgJhpB0roD/tWIEw0o6VP+1YgTDSjpU/KK+hvIbymj8or6G8hvKaPwAAAAAAAAAA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[12]}},\"selected\":{\"id\":\"3339\"},\"selection_policy\":{\"id\":\"3340\"}},\"id\":\"3327\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3328\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3344\",\"type\":\"Patch\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3337\"},\"ticker\":{\"id\":\"3306\"}},\"id\":\"3305\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"3472\"}},\"id\":\"3476\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3306\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3379\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"3398\"},\"glyph\":{\"id\":\"3399\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3400\"},\"selection_glyph\":null,\"view\":{\"id\":\"3402\"}},\"id\":\"3401\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3303\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"3500\"},\"glyph\":{\"id\":\"3501\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3502\"},\"selection_glyph\":null,\"view\":{\"id\":\"3504\"}},\"id\":\"3503\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3676\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3298\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#d62628\",\"line_alpha\":0.1,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3474\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"3472\"},\"glyph\":{\"id\":\"3473\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3474\"},\"selection_glyph\":null,\"view\":{\"id\":\"3476\"}},\"id\":\"3475\",\"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\",\"top_units\":\"screen\"},\"id\":\"3319\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"3498\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3499\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"3445\"},\"glyph\":{\"id\":\"3446\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3447\"},\"selection_glyph\":null,\"view\":{\"id\":\"3449\"}},\"id\":\"3448\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3310\",\"type\":\"BasicTicker\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3333\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3313\"},{\"id\":\"3314\"},{\"id\":\"3315\"},{\"id\":\"3316\"},{\"id\":\"3317\"},{\"id\":\"3318\"}]},\"id\":\"3320\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3516\",\"type\":\"MultiLine\"},{\"attributes\":{\"data_source\":{\"id\":\"3505\"},\"glyph\":{\"id\":\"3506\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3507\"},\"selection_glyph\":null,\"view\":{\"id\":\"3509\"}},\"id\":\"3508\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3501\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"3677\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3329\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3511\",\"type\":\"MultiLine\"},{\"attributes\":{\"source\":{\"id\":\"3327\"}},\"id\":\"3331\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3506\",\"type\":\"MultiLine\"},{\"attributes\":{\"source\":{\"id\":\"3500\"}},\"id\":\"3504\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3502\",\"type\":\"MultiLine\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"3342\"},{\"id\":\"3377\"},{\"id\":\"3420\"},{\"id\":\"3471\"}],\"location\":\"top_left\"},\"id\":\"3341\",\"type\":\"Legend\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"3330\"},{\"id\":\"3346\"}]},\"id\":\"3342\",\"type\":\"LegendItem\"},{\"attributes\":{\"data\":{\"xs\":[[90.0,90.0],[82.5,82.5],[67.5,67.5],[85.0,85.0],[75.0,75.0],[97.5,97.5]],\"ys\":[[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583]]},\"selected\":{\"id\":\"3678\"},\"selection_policy\":{\"id\":\"3679\"}},\"id\":\"3505\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"3510\"},\"glyph\":{\"id\":\"3511\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3512\"},\"selection_glyph\":null,\"view\":{\"id\":\"3514\"}},\"id\":\"3513\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3301\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"3319\"}},\"id\":\"3315\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"3505\"}},\"id\":\"3509\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3507\",\"type\":\"MultiLine\"},{\"attributes\":{\"data\":{\"xs\":[[72.5,72.5],[85.0,85.0],[75.0,75.0],[67.5,67.5],[95.0,95.0],[87.5,87.5],[92.5,92.5],[100.0,100.0],[70.0,70.0],[85.0,85.0],[92.5,92.5],[65.0,65.0],[80.0,80.0],[90.0,90.0],[87.5,87.5],[75.0,75.0],[77.5,77.5],[72.5,72.5],[87.5,87.5],[87.5,87.5],[90.0,90.0],[87.5,87.5],[90.0,90.0],[80.0,80.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[85.0,85.0],[90.0,90.0],[100.0,100.0],[85.0,85.0],[87.5,87.5],[97.5,97.5],[92.5,92.5],[100.0,100.0],[60.0,60.0],[95.0,95.0],[77.5,77.5],[77.5,77.5],[82.5,82.5],[87.5,87.5],[85.0,85.0],[77.5,77.5],[62.5,62.5],[72.5,72.5],[85.0,85.0],[92.5,92.5],[55.0,55.0],[60.0,60.0],[77.5,77.5],[87.5,87.5],[75.0,75.0],[70.0,70.0],[62.5,62.5]],\"ys\":[[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583]]},\"selected\":{\"id\":\"3680\"},\"selection_policy\":{\"id\":\"3681\"}},\"id\":\"3510\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"3515\"},\"glyph\":{\"id\":\"3516\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3517\"},\"selection_glyph\":null,\"view\":{\"id\":\"3519\"}},\"id\":\"3518\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"3510\"}},\"id\":\"3514\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3512\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"3678\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"xs\":[[90.0,90.0],[85.0,85.0],[77.5,77.5],[92.5,92.5],[57.5,57.5],[95.0,95.0],[77.5,77.5],[80.0,80.0],[92.5,92.5],[67.5,67.5],[72.5,72.5],[85.0,85.0],[80.0,80.0],[77.5,77.5],[77.5,77.5],[40.0,40.0],[87.5,87.5],[85.0,85.0],[72.5,72.5],[90.0,90.0],[90.0,90.0],[87.5,87.5]],\"ys\":[[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583],[0,0.0023140495867768583]]},\"selected\":{\"id\":\"3682\"},\"selection_policy\":{\"id\":\"3683\"}},\"id\":\"3515\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3515\"}},\"id\":\"3519\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":0.5},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"3517\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"3679\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3335\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"3305\"},\"ticker\":null},\"id\":\"3308\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3337\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"3309\"},\"dimension\":1,\"ticker\":null},\"id\":\"3312\",\"type\":\"Grid\"}],\"root_ids\":[\"3297\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"cc4e9561-0004-4eb1-b452-d2cd1fdc8138\",\"root_ids\":[\"3297\"],\"roots\":{\"3297\":\"40cf5c44-411f-4170-94ec-c37f5805ff8d\"}}];\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": "3297" } }, "output_type": "display_data" } ], "source": [ "# Plot the histogram\n", "p = iqplot.histogram(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " density=True,\n", " frame_width=525,\n", ")\n", "\n", "p.legend.location = 'top_left'\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 formal staircase." ] }, { "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 = {\"ac6239ea-e616-4d48-92c3-b5b52481e814\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3848\"}],\"center\":[{\"id\":\"3851\"},{\"id\":\"3855\"},{\"id\":\"3885\"}],\"frame_height\":275,\"frame_width\":375,\"left\":[{\"id\":\"3852\"}],\"renderers\":[{\"id\":\"3874\"},{\"id\":\"3891\"},{\"id\":\"3909\"},{\"id\":\"3929\"}],\"title\":{\"id\":\"3877\"},\"toolbar\":{\"id\":\"3863\"},\"x_range\":{\"id\":\"3840\"},\"x_scale\":{\"id\":\"3844\"},\"y_range\":{\"id\":\"3842\"},\"y_scale\":{\"id\":\"3846\"}},\"id\":\"3839\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"3909\"}]},\"id\":\"3924\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"3870\"}},\"id\":\"3875\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3902\",\"type\":\"Selection\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"3886\"},{\"id\":\"3904\"},{\"id\":\"3924\"},{\"id\":\"3946\"}],\"location\":\"top_left\"},\"id\":\"3885\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"3870\"},\"glyph\":{\"id\":\"3872\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3873\"},\"selection_glyph\":null,\"view\":{\"id\":\"3875\"}},\"id\":\"3874\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3840\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b3\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3873\",\"type\":\"Circle\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3872\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#d62628\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3928\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3883\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"3874\"}]},\"id\":\"3886\",\"type\":\"LegendItem\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3877\",\"type\":\"Title\"},{\"attributes\":{\"axis\":{\"id\":\"3848\"},\"ticker\":null},\"id\":\"3851\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3884\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3846\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3945\",\"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\",\"top_units\":\"screen\"},\"id\":\"3862\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"3944\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3881\"},\"ticker\":{\"id\":\"3849\"}},\"id\":\"3848\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"3925\"}},\"id\":\"3930\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3842\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"3905\"}},\"id\":\"3910\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3925\"},\"glyph\":{\"id\":\"3927\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3928\"},\"selection_glyph\":null,\"view\":{\"id\":\"3930\"}},\"id\":\"3929\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3844\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"3905\"},\"glyph\":{\"id\":\"3907\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3908\"},\"selection_glyph\":null,\"view\":{\"id\":\"3910\"}},\"id\":\"3909\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3849\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3857\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#2ba02b\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3908\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3890\",\"type\":\"Circle\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3907\",\"type\":\"Circle\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"3879\"},\"ticker\":{\"id\":\"3853\"}},\"id\":\"3852\",\"type\":\"LinearAxis\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"3891\"}]},\"id\":\"3904\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis\":{\"id\":\"3852\"},\"dimension\":1,\"ticker\":null},\"id\":\"3855\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3879\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3889\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"3dzc3NzczD9LS0tLS0vrP7W0tLS0tOQ/FBQUFBQUtD8eHh4eHh6eP8nIyMjIyOg/MjIyMjIy0j+XlpaWlpa2P319fX19fe0/+/r6+vr62j+cm5ubm5vbPx4eHh4eHr4/VVVVVVVVxT+XlpaWlpbGPzw8PDw8PNw/2NfX19fXxz8FBQUFBQXlPxQUFBQUFJQ/GRkZGRkZyT8=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[19]},\"__label\":[\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\",\"female, insomniac\"],\"gender\":[\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"index\":[0,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,22,23,24],\"percent correct\":{\"__ndarray__\":\"AAAAAAAgUkAAAAAAACBXQAAAAAAA4FVAAAAAAABAT0AAAAAAAABJQAAAAAAAgFZAAAAAAADAUkAAAAAAAEBPQAAAAAAAwFdAAAAAAAAAVEAAAAAAAABUQAAAAAAAQFBAAAAAAACAUUAAAAAAAIBRQAAAAAAAAFRAAAAAAACAUUAAAAAAAOBVQAAAAAAAgEZAAAAAAACAUUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[19]},\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\"]},\"selected\":{\"id\":\"3883\"},\"selection_policy\":{\"id\":\"3884\"}},\"id\":\"3870\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"GRkZGRkZ6T/x8PDw8PDgP1VVVVVVVdU/7Ovr6+vr6z8ZGRkZGRmpPx4eHh4eHu4/9vX19fX11T99fX19fX3dP42MjIyMjOw/FBQUFBQUxD9QUFBQUFDQP5KRkZGRkeE/Hh4eHh4e3j83Nzc3NzfXP9jX19fX19c/FBQUFBQUhD+Ih4eHh4fnP2RkZGRkZOQ/kpGRkZGR0T+rqqqqqqrqP/v6+vr6+uo/2NfX19fX5z8=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[22]},\"__label\":[\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\",\"male, normal\"],\"gender\":[\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\",\"male\"],\"index\":[32,35,36,37,39,42,43,46,48,50,53,54,59,64,68,81,84,90,91,92,93,95],\"percent correct\":{\"__ndarray__\":\"AAAAAACAVkAAAAAAAEBVQAAAAAAAYFNAAAAAAAAgV0AAAAAAAMBMQAAAAAAAwFdAAAAAAABgU0AAAAAAAABUQAAAAAAAIFdAAAAAAADgUEAAAAAAACBSQAAAAAAAQFVAAAAAAAAAVEAAAAAAAGBTQAAAAAAAYFNAAAAAAAAAREAAAAAAAOBVQAAAAAAAQFVAAAAAAAAgUkAAAAAAAIBWQAAAAAAAgFZAAAAAAADgVUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[22]},\"sleeper\":[\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"3944\"},\"selection_policy\":{\"id\":\"3945\"}},\"id\":\"3925\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3853\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3923\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3856\"},{\"id\":\"3857\"},{\"id\":\"3858\"},{\"id\":\"3859\"},{\"id\":\"3860\"},{\"id\":\"3861\"}]},\"id\":\"3863\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"3922\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3881\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3861\",\"type\":\"HelpTool\"},{\"attributes\":{\"source\":{\"id\":\"3887\"}},\"id\":\"3892\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3856\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"3887\"},\"glyph\":{\"id\":\"3889\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3890\"},\"selection_glyph\":null,\"view\":{\"id\":\"3892\"}},\"id\":\"3891\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"3862\"}},\"id\":\"3858\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3927\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3859\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"3860\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"Hh4eHh4ezj+hoKCgoKDgP3Nzc3Nzc9M/09LS0tLSwj/Ozc3Nzc3tP1VVVVVVVeU/nJubm5ub6z9fX19fX1/vP1paWlpaWso/QUFBQUFB4T88PDw8PDzsP1BQUFBQUMA/3dzc3Nzc3D9paWlpaWnpP6alpaWlpeU/FBQUFBQU1D+XlpaWlpbWP19fX19fX88/9vX19fX15T9GRkZGRkbmP7q5ubm5uek/l5aWlpaW5j8KCgoKCgrqP7++vr6+vt4/4uHh4eHh4T8yMjIyMjLiP4OCgoKCguI/09LS0tLS4j8jIyMjIyPjP1paWlpaWuo/sK+vr6+v7z9zc3Nzc3PjP+fm5ubm5uY/Dw8PDw8P7z/d3Nzc3NzsPwAAAAAAAPA/Hh4eHh4erj9ubm5ubm7uP3h4eHh4eNg/GRkZGRkZ2T8AAAAAAADgPzc3Nzc3N+c/xMPDw8PD4z+6ubm5ubnZPxkZGRkZGbk/8fDw8PDw0D8UFBQUFBTkPy0tLS0tLe0/FBQUFBQUpD+SkZGRkZGxP1paWlpaWto/KCgoKCgo6D+1tLS0tLTUP5ybm5ubm8s/nJubm5ubuz8=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[55]},\"__label\":[\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\",\"female, normal\"],\"gender\":[\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\",\"female\"],\"index\":[25,26,27,28,29,30,31,33,34,38,40,41,44,45,47,49,51,52,55,56,57,58,60,61,62,63,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,82,83,85,86,87,88,89,94,96,97,98,99,100,101],\"percent correct\":{\"__ndarray__\":\"AAAAAAAgUkAAAAAAAEBVQAAAAAAAwFJAAAAAAADgUEAAAAAAAMBXQAAAAAAA4FVAAAAAAAAgV0AAAAAAAABZQAAAAAAAgFFAAAAAAABAVUAAAAAAACBXQAAAAAAAQFBAAAAAAAAAVEAAAAAAAIBWQAAAAAAA4FVAAAAAAADAUkAAAAAAAGBTQAAAAAAAIFJAAAAAAADgVUAAAAAAAOBVQAAAAAAAgFZAAAAAAADgVUAAAAAAAIBWQAAAAAAAAFRAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAgFZAAAAAAAAAWUAAAAAAAEBVQAAAAAAA4FVAAAAAAABgWEAAAAAAACBXQAAAAAAAAFlAAAAAAAAATkAAAAAAAMBXQAAAAAAAYFNAAAAAAABgU0AAAAAAAKBUQAAAAAAA4FVAAAAAAABAVUAAAAAAAGBTQAAAAAAAQE9AAAAAAAAgUkAAAAAAAEBVQAAAAAAAIFdAAAAAAACAS0AAAAAAAABOQAAAAAAAYFNAAAAAAADgVUAAAAAAAMBSQAAAAAAAgFFAAAAAAABAT0A=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[55]},\"sleeper\":[\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\",\"normal\"]},\"selected\":{\"id\":\"3922\"},\"selection_policy\":{\"id\":\"3923\"}},\"id\":\"3905\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"__ECDF\":{\"__ndarray__\":\"eHh4eHh46D9fX19fX1/fP5KRkZGRkcE/UFBQUFBQ4D/T0tLS0tLSP7++vr6+vu4/\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[6]},\"__label\":[\"male, insomniac\",\"male, insomniac\",\"male, insomniac\",\"male, insomniac\",\"male, insomniac\",\"male, insomniac\"],\"gender\":[\"male\",\"male\",\"male\",\"male\",\"male\",\"male\"],\"index\":[1,6,7,18,19,21],\"percent correct\":{\"__ndarray__\":\"AAAAAACAVkAAAAAAAKBUQAAAAAAA4FBAAAAAAABAVUAAAAAAAMBSQAAAAAAAYFhA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[6]},\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\"]},\"selected\":{\"id\":\"3902\"},\"selection_policy\":{\"id\":\"3903\"}},\"id\":\"3887\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"3929\"}]},\"id\":\"3946\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"3903\",\"type\":\"UnionRenderers\"}],\"root_ids\":[\"3839\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.1\"}};\n", " var render_items = [{\"docid\":\"ac6239ea-e616-4d48-92c3-b5b52481e814\",\"root_ids\":[\"3839\"],\"roots\":{\"3839\":\"fb09f179-f315-4d62-b15c-79d323017843\"}}];\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": "3839" } }, "output_type": "display_data" } ], "source": [ "p = iqplot.ecdf(\n", " data=df,\n", " q='percent correct',\n", " cats=['gender', 'sleeper'],\n", " kind='colored',\n", ")\n", "\n", "p.legend.location = 'top_left'\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In general, for customization, you should check [the documentation](https://iqplot.github.io/) to see what is available." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing environment" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPython 3.8.5\n", "IPython 7.18.1\n", "\n", "pandas 1.1.1\n", "bokeh 2.2.1\n", "iqplot 0.1.6\n", "jupyterlab 2.2.6\n" ] } ], "source": [ "%load_ext watermark\n", "%watermark -v -p pandas,bokeh,iqplot,jupyterlab" ] } ], "metadata": { "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.5" } }, "nbformat": 4, "nbformat_minor": 4 }