{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Bokeh-catplot\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", " }\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", " 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", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " };var element = document.getElementById(\"1001\");\n", " if (element == null) {\n", " console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n", " return false;\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", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.3.4.min.js\"];\n", " var css_urls = [];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {} // ensure no trailing comma for IE\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\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 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 console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };var element = document.getElementById(\"1001\");\n if (element == null) {\n console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n return false;\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 var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.3.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.3.4.min.js\"];\n var css_urls = [];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd\n", "\n", "import bokeh_catplot\n", "\n", "import bokeh.io\n", "bokeh.io.output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "This notebook uses an updated version of Bokeh-catplot. Be sure to update it before running this notebook by doing the following on the commmand line.\n", "\n", " pip install --upgrade bokeh-catplot" ] }, { "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 needs, I developed [Bokeh-catplot](https://github.com/justinbois/bokeh-catplot), which generates Bokeh plots from tidy data frames where one or more columns contains categorical data and the column of interest in the plot is quantitative. Eventually, this package will become obsolete when HoloViews incorporates the functionality. But for now, Bokeh-catplot is a convenient package for making plots involving categorical variables.\n", "\n", "There are four types of plots that Bokeh-catplot can generate. As you will see, all four of these modes of plotting are meant to give a picture about how the quantitative measurements are *distributed* for each category.\n", "\n", "- **Plots with a categorical axis**\n", " + Box plots: `bokeh_catplot.box()`\n", " + Strip plots: `bokeh_catplot.strip()`\n", " \n", " \n", "- **Plots without a categorical axis**\n", " + Histograms: `bokeh_catplot.histogram()`\n", " + [ECDFs](https://en.wikipedia.org/wiki/Empirical_distribution_function): `bokeh_catplot.ecdf()`\n", " \n", "\n", "The first three arguments of each of these functions are necessary to build the plot. They are:\n", "\n", "- `data`: A tidy data frame\n", "- `cats`: A list of columns in the data frame that are to be considered as categorical variables in the plot. If `None`, a single box, strip, histogram, or ECDF is plotted.\n", "- `val`: The column of the data frame to be treated as the quantitative variable. \n", "\n", "With this in mind, we will put Bokeh-catplot to use on facial identification data set." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv('../data/gfmt_sleep.csv', 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 = {\"a0fd9922-1ac7-4363-b5aa-001649ecaaf0\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1011\",\"type\":\"CategoricalAxis\"}],\"center\":[{\"id\":\"1014\",\"type\":\"Grid\"},{\"id\":\"1019\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1015\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1041\",\"type\":\"GlyphRenderer\"},{\"id\":\"1046\",\"type\":\"GlyphRenderer\"},{\"id\":\"1051\",\"type\":\"GlyphRenderer\"},{\"id\":\"1056\",\"type\":\"GlyphRenderer\"},{\"id\":\"1061\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1063\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1026\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1002\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"1007\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"1005\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1009\",\"type\":\"LinearScale\"}},\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1049\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1050\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"1052\",\"type\":\"CDSView\"}},\"id\":\"1051\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1055\",\"type\":\"VBar\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1065\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1016\",\"type\":\"BasicTicker\"}},\"id\":\"1015\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1035\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1036\",\"type\":\"CategoricalColorMapper\"}},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"1059\",\"type\":\"Circle\"},{\"attributes\":{\"formatter\":{\"id\":\"1067\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"1012\",\"type\":\"CategoricalTicker\"}},\"id\":\"1011\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"}},\"id\":\"1042\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1034\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1059\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1060\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1062\",\"type\":\"CDSView\"}},\"id\":\"1061\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1067\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"callback\":null,\"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\":\"1072\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1071\",\"type\":\"UnionRenderers\"}},\"id\":\"1034\",\"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\":\"1036\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1054\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1055\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"1057\",\"type\":\"CDSView\"}},\"id\":\"1056\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"1044\",\"type\":\"Segment\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1050\",\"type\":\"VBar\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1020\",\"type\":\"PanTool\"},{\"id\":\"1021\",\"type\":\"WheelZoomTool\"},{\"id\":\"1022\",\"type\":\"BoxZoomTool\"},{\"id\":\"1023\",\"type\":\"SaveTool\"},{\"id\":\"1024\",\"type\":\"ResetTool\"},{\"id\":\"1025\",\"type\":\"HelpTool\"}]},\"id\":\"1026\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"1045\",\"type\":\"Segment\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1063\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"}},\"id\":\"1052\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1073\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"1002\",\"type\":\"FactorRange\"},{\"attributes\":{\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"1039\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1039\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1040\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"1042\",\"type\":\"CDSView\"}},\"id\":\"1041\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1069\",\"type\":\"UnionRenderers\"},{\"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\":{},\"id\":\"1021\",\"type\":\"WheelZoomTool\"},{\"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\":\"1037\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"overlay\":{\"id\":\"1073\",\"type\":\"BoxAnnotation\"}},\"id\":\"1022\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"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\":\"1070\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1069\",\"type\":\"UnionRenderers\"}},\"id\":\"1033\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"}},\"id\":\"1057\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1034\",\"type\":\"ColumnDataSource\"}},\"id\":\"1062\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1044\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1045\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"1047\",\"type\":\"CDSView\"}},\"id\":\"1046\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1072\",\"type\":\"Selection\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1037\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"1049\",\"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\":\"1054\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"1071\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1025\",\"type\":\"HelpTool\"},{\"attributes\":{\"grid_line_color\":null,\"ticker\":{\"id\":\"1012\",\"type\":\"CategoricalTicker\"}},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1065\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1033\",\"type\":\"ColumnDataSource\"}},\"id\":\"1047\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1070\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"1060\",\"type\":\"Circle\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1016\",\"type\":\"BasicTicker\"}},\"id\":\"1019\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"1040\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"CategoricalTicker\"}],\"root_ids\":[\"1003\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"a0fd9922-1ac7-4363-b5aa-001649ecaaf0\",\"roots\":{\"1003\":\"a93eb945-42c3-4ddc-bcac-8da0b8380c11\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\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 = bokeh_catplot.box(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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 = {\"085a4061-10d6-4043-9c98-30e7b17d79d7\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1149\",\"type\":\"CategoricalAxis\"}],\"center\":[{\"id\":\"1152\",\"type\":\"Grid\"},{\"id\":\"1157\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1153\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1177\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1190\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1164\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1140\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"1145\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"1143\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1147\",\"type\":\"LinearScale\"}},\"id\":\"1141\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1172\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1175\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1176\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1178\",\"type\":\"CDSView\"}},\"id\":\"1177\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1158\",\"type\":\"PanTool\"},{\"id\":\"1159\",\"type\":\"WheelZoomTool\"},{\"id\":\"1160\",\"type\":\"BoxZoomTool\"},{\"id\":\"1161\",\"type\":\"SaveTool\"},{\"id\":\"1162\",\"type\":\"ResetTool\"},{\"id\":\"1163\",\"type\":\"HelpTool\"}]},\"id\":\"1164\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"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\":\"1197\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1196\",\"type\":\"UnionRenderers\"}},\"id\":\"1172\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1162\",\"type\":\"ResetTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1190\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1158\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1161\",\"type\":\"SaveTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1198\",\"type\":\"BoxAnnotation\"}},\"id\":\"1160\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1147\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1154\",\"type\":\"BasicTicker\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"1140\",\"type\":\"FactorRange\"},\"width\":0.1},\"id\":\"1173\",\"type\":\"Jitter\"},{\"attributes\":{},\"id\":\"1196\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1154\",\"type\":\"BasicTicker\"}},\"id\":\"1157\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"1143\",\"type\":\"DataRange1d\"},{\"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\":\"1171\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1192\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1154\",\"type\":\"BasicTicker\"}},\"id\":\"1153\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1145\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1197\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1198\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"1140\",\"type\":\"FactorRange\"},{\"attributes\":{\"source\":{\"id\":\"1172\",\"type\":\"ColumnDataSource\"}},\"id\":\"1178\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1192\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1159\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1150\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"1194\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"1173\",\"type\":\"Jitter\"}},\"y\":{\"field\":\"percent correct\"}},\"id\":\"1176\",\"type\":\"Circle\"},{\"attributes\":{\"formatter\":{\"id\":\"1194\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"1150\",\"type\":\"CategoricalTicker\"}},\"id\":\"1149\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1163\",\"type\":\"HelpTool\"},{\"attributes\":{\"grid_line_color\":null,\"ticker\":{\"id\":\"1150\",\"type\":\"CategoricalTicker\"}},\"id\":\"1152\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1171\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"1171\",\"type\":\"CategoricalColorMapper\"}},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"1173\",\"type\":\"Jitter\"}},\"y\":{\"field\":\"percent correct\"}},\"id\":\"1175\",\"type\":\"Circle\"}],\"root_ids\":[\"1141\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"085a4061-10d6-4043-9c98-30e7b17d79d7\",\"roots\":{\"1141\":\"a8172706-abd3-459c-b2bb-45336ad9855c\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1141" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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": 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 = {\"5f767dbd-8724-4cca-8ae7-495a63554e7e\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1262\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1266\",\"type\":\"Grid\"},{\"id\":\"1271\",\"type\":\"Grid\"},{\"id\":\"1297\",\"type\":\"Legend\"}],\"left\":[{\"id\":\"1267\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1288\",\"type\":\"GlyphRenderer\"},{\"id\":\"1302\",\"type\":\"GlyphRenderer\"},{\"id\":\"1316\",\"type\":\"GlyphRenderer\"},{\"id\":\"1333\",\"type\":\"GlyphRenderer\"},{\"id\":\"1351\",\"type\":\"GlyphRenderer\"},{\"id\":\"1372\",\"type\":\"GlyphRenderer\"},{\"id\":\"1394\",\"type\":\"GlyphRenderer\"},{\"id\":\"1419\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1290\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1278\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1255\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1258\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1253\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1260\",\"type\":\"LinearScale\"}},\"id\":\"1254\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1440\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1439\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1286\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1258\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1260\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null},\"id\":\"1255\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1294\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1263\",\"type\":\"BasicTicker\"}},\"id\":\"1262\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1268\",\"type\":\"BasicTicker\"}},\"id\":\"1271\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1263\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"1263\",\"type\":\"BasicTicker\"}},\"id\":\"1266\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1268\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis_label\":\"count\",\"formatter\":{\"id\":\"1292\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1268\",\"type\":\"BasicTicker\"}},\"id\":\"1267\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1483\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1272\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1273\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1296\",\"type\":\"BoxAnnotation\"}},\"id\":\"1274\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"}},\"id\":\"1289\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1345\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1275\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1292\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1346\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1276\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1348\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1349\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1350\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1352\",\"type\":\"CDSView\"}},\"id\":\"1351\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1296\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"1253\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1277\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1294\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0A=\",\"dtype\":\"float64\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAAGEAAAAAAAAAYQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAgQAAAAAAAACBAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[16]}},\"selected\":{\"id\":\"1440\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1439\",\"type\":\"UnionRenderers\"}},\"id\":\"1391\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1286\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1287\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1289\",\"type\":\"CDSView\"}},\"id\":\"1288\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1272\",\"type\":\"PanTool\"},{\"id\":\"1273\",\"type\":\"WheelZoomTool\"},{\"id\":\"1274\",\"type\":\"BoxZoomTool\"},{\"id\":\"1275\",\"type\":\"SaveTool\"},{\"id\":\"1276\",\"type\":\"ResetTool\"},{\"id\":\"1277\",\"type\":\"HelpTool\"}]},\"id\":\"1278\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1350\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQA==\",\"dtype\":\"float64\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[8]}},\"selected\":{\"id\":\"1346\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1345\",\"type\":\"UnionRenderers\"}},\"id\":\"1313\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1369\",\"type\":\"ColumnDataSource\"}},\"id\":\"1373\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1348\",\"type\":\"ColumnDataSource\"}},\"id\":\"1352\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1365\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1314\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"1351\",\"type\":\"GlyphRenderer\"},{\"id\":\"1372\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1368\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"1311\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1310\",\"type\":\"UnionRenderers\"}},\"id\":\"1285\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1290\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1366\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1370\",\"type\":\"Patch\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAgEtA\",\"dtype\":\"float64\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAIQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJkAAAAAAAAAmQAAAAAAAADBAAAAAAAAAMEAAAAAAAAAYQAAAAAAAABhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[18]}},\"selected\":{\"id\":\"1413\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1412\",\"type\":\"UnionRenderers\"}},\"id\":\"1369\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1300\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1313\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1314\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1315\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1317\",\"type\":\"CDSView\"}},\"id\":\"1316\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1287\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1371\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1369\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1370\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1371\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"1373\",\"type\":\"CDSView\"}},\"id\":\"1372\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAIBGQA==\",\"dtype\":\"float64\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABhAAAAAAAAAGEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[14]}},\"selected\":{\"id\":\"1327\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1326\",\"type\":\"UnionRenderers\"}},\"id\":\"1299\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1299\",\"type\":\"ColumnDataSource\"}},\"id\":\"1303\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1301\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1299\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1300\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1301\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"1303\",\"type\":\"CDSView\"}},\"id\":\"1302\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1388\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1298\",\"type\":\"LegendItem\"},{\"id\":\"1329\",\"type\":\"LegendItem\"},{\"id\":\"1368\",\"type\":\"LegendItem\"},{\"id\":\"1415\",\"type\":\"LegendItem\"}],\"location\":\"top_left\"},\"id\":\"1297\",\"type\":\"Legend\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1349\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"1288\",\"type\":\"GlyphRenderer\"},{\"id\":\"1302\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1298\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1389\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1482\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1391\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1392\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1393\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1395\",\"type\":\"CDSView\"}},\"id\":\"1394\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1310\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1311\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1393\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1315\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1391\",\"type\":\"ColumnDataSource\"}},\"id\":\"1395\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1412\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"1313\",\"type\":\"ColumnDataSource\"}},\"id\":\"1317\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"1394\",\"type\":\"GlyphRenderer\"},{\"id\":\"1419\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1415\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1326\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1413\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"1316\",\"type\":\"GlyphRenderer\"},{\"id\":\"1333\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1329\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAAERA\",\"dtype\":\"float64\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAAGEAAAAAAAAAYQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAgQAAAAAAAACBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[18]}},\"selected\":{\"id\":\"1483\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1482\",\"type\":\"UnionRenderers\"}},\"id\":\"1416\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1327\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQAAAAAAAYFhAAAAAAADgUEA=\",\"dtype\":\"float64\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[10]}},\"selected\":{\"id\":\"1366\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1365\",\"type\":\"UnionRenderers\"}},\"id\":\"1330\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1417\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"1416\",\"type\":\"ColumnDataSource\"}},\"id\":\"1420\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1331\",\"type\":\"Patch\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1418\",\"type\":\"Patch\"},{\"attributes\":{\"source\":{\"id\":\"1330\",\"type\":\"ColumnDataSource\"}},\"id\":\"1334\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1416\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1417\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1418\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"1420\",\"type\":\"CDSView\"}},\"id\":\"1419\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1332\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"1330\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1331\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1332\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"1334\",\"type\":\"CDSView\"}},\"id\":\"1333\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUA=\",\"dtype\":\"float64\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAAAAAAAAAAIQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJkAAAAAAAAAmQAAAAAAAADBAAAAAAAAAMEAAAAAAAAAYQAAAAAAAABhAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[16]}},\"selected\":{\"id\":\"1389\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1388\",\"type\":\"UnionRenderers\"}},\"id\":\"1348\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1392\",\"type\":\"Line\"}],\"root_ids\":[\"1254\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"5f767dbd-8724-4cca-8ae7-495a63554e7e\",\"roots\":{\"1254\":\"da55072c-35c7-4a10-8445-29c8324613ff\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1254" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.histogram(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", ")\n", "\n", "p.legend.location = 'top_left'\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### ECDF\n", "\n", "HoloViews does not have native ECDF support." ] }, { "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 = {\"11efe354-3c63-49fd-b502-1600f34927cd\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1632\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1636\",\"type\":\"Grid\"},{\"id\":\"1641\",\"type\":\"Grid\"},{\"id\":\"1667\",\"type\":\"Legend\"}],\"left\":[{\"id\":\"1637\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"1658\",\"type\":\"GlyphRenderer\"},{\"id\":\"1672\",\"type\":\"GlyphRenderer\"},{\"id\":\"1686\",\"type\":\"GlyphRenderer\"},{\"id\":\"1702\",\"type\":\"GlyphRenderer\"},{\"id\":\"1721\",\"type\":\"GlyphRenderer\"},{\"id\":\"1741\",\"type\":\"GlyphRenderer\"},{\"id\":\"1763\",\"type\":\"GlyphRenderer\"},{\"id\":\"1788\",\"type\":\"GlyphRenderer\"},{\"id\":\"1814\",\"type\":\"GlyphRenderer\"},{\"id\":\"1842\",\"type\":\"GlyphRenderer\"},{\"id\":\"1873\",\"type\":\"GlyphRenderer\"},{\"id\":\"1905\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1660\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1648\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1624\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1628\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1626\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1630\",\"type\":\"LinearScale\"}},\"id\":\"1623\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":45.0},\"y\":{\"value\":0}},\"id\":\"1671\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1647\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQAAAAAAAAE5AAAAAAAAATkAAAAAAAABOQAAAAAAAAE5AAAAAAABAT0AAAAAAAEBPQAAAAAAAQE9AAAAAAABAT0AAAAAAAEBQQAAAAAAAQFBAAAAAAADgUEAAAAAAAOBQQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAADAUkAAAAAAAMBSQAAAAAAAwFJAAAAAAADAUkAAAAAAAMBSQAAAAAAAwFJAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAABUQAAAAAAAoFRAAAAAAACgVEAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAwFdAAAAAAABgWEAAAAAAAGBYQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQA==\",\"dtype\":\"float64\",\"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\",\"shape\":[110]}},\"selected\":{\"id\":\"1809\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1808\",\"type\":\"UnionRenderers\"}},\"id\":\"1760\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1642\",\"type\":\"PanTool\"},{\"id\":\"1643\",\"type\":\"WheelZoomTool\"},{\"id\":\"1644\",\"type\":\"BoxZoomTool\"},{\"id\":\"1645\",\"type\":\"SaveTool\"},{\"id\":\"1646\",\"type\":\"ResetTool\"},{\"id\":\"1647\",\"type\":\"HelpTool\"}]},\"id\":\"1648\",\"type\":\"Toolbar\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"1702\",\"type\":\"GlyphRenderer\"},{\"id\":\"1721\",\"type\":\"GlyphRenderer\"},{\"id\":\"1741\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1717\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"1669\",\"type\":\"ColumnDataSource\"}},\"id\":\"1673\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1696\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1735\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1837\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1699\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1700\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1701\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1703\",\"type\":\"CDSView\"}},\"id\":\"1702\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"1624\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1656\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAAElAAAAAAAAASUAAAAAAAEBPQAAAAAAAQE9AAAAAAABAT0AAAAAAAEBPQAAAAAAAQFBAAAAAAABAUEAAAAAAAIBRQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAACAUUAAAAAAAIBRQAAAAAAAgFFAAAAAAAAgUkAAAAAAACBSQAAAAAAAwFJAAAAAAADAUkAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAAgFZAAAAAAACAVkAAAAAAACBXQAAAAAAAIFdAAAAAAADAV0AAAAAAAMBXQA==\",\"dtype\":\"float64\",\"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\",\"shape\":[38]}},\"selected\":{\"id\":\"1681\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1680\",\"type\":\"UnionRenderers\"}},\"id\":\"1655\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1683\",\"type\":\"ColumnDataSource\"}},\"id\":\"1687\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"1699\",\"type\":\"ColumnDataSource\"}},\"id\":\"1703\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2008\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1657\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"1655\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1656\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1657\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1659\",\"type\":\"CDSView\"}},\"id\":\"1658\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1715\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"1655\",\"type\":\"ColumnDataSource\"}},\"id\":\"1659\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1660\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"1626\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1628\",\"type\":\"LinearScale\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"1668\",\"type\":\"LegendItem\"},{\"id\":\"1717\",\"type\":\"LegendItem\"},{\"id\":\"1784\",\"type\":\"LegendItem\"},{\"id\":\"1869\",\"type\":\"LegendItem\"}],\"location\":\"top_left\"},\"id\":\"1667\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"1664\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1761\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2007\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1666\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1630\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1662\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"1664\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1633\",\"type\":\"BasicTicker\"}},\"id\":\"1632\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1638\",\"type\":\"BasicTicker\"}},\"id\":\"1641\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1633\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"1658\",\"type\":\"GlyphRenderer\"},{\"id\":\"1672\",\"type\":\"GlyphRenderer\"},{\"id\":\"1686\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1668\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1714\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"ticker\":{\"id\":\"1633\",\"type\":\"BasicTicker\"}},\"id\":\"1636\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1701\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1758\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1757\",\"type\":\"UnionRenderers\"}},\"id\":\"1718\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1638\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"1662\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1638\",\"type\":\"BasicTicker\"}},\"id\":\"1637\",\"type\":\"LinearAxis\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":67.5},\"y\":{\"value\":0}},\"id\":\"1719\",\"type\":\"Ray\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1782\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1781\",\"type\":\"UnionRenderers\"}},\"id\":\"1738\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":67.5},\"y\":{\"value\":0}},\"id\":\"1720\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1697\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1684\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"1718\",\"type\":\"ColumnDataSource\"}},\"id\":\"1722\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1718\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1719\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1720\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1722\",\"type\":\"CDSView\"}},\"id\":\"1721\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1697\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1696\",\"type\":\"UnionRenderers\"}},\"id\":\"1669\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1642\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQAAAAAAAwExAAAAAAADATEAAAAAAAOBQQAAAAAAA4FBAAAAAAAAgUkAAAAAAACBSQAAAAAAAIFJAAAAAAAAgUkAAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAABgU0AAAAAAAGBTQAAAAAAAYFNAAAAAAAAAVEAAAAAAAABUQAAAAAAAAFRAAAAAAAAAVEAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAEBVQAAAAAAAQFVAAAAAAABAVUAAAAAAAOBVQAAAAAAA4FVAAAAAAADgVUAAAAAAAOBVQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAgFZAAAAAAACAVkAAAAAAAIBWQAAAAAAAIFdAAAAAAAAgV0AAAAAAACBXQAAAAAAAIFdAAAAAAADAV0AAAAAAAMBXQA==\",\"dtype\":\"float64\",\"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\",\"shape\":[44]}},\"selected\":{\"id\":\"1900\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1899\",\"type\":\"UnionRenderers\"}},\"id\":\"1839\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1643\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1736\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1738\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1739\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1740\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1742\",\"type\":\"CDSView\"}},\"id\":\"1741\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1646\",\"type\":\"ResetTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1666\",\"type\":\"BoxAnnotation\"}},\"id\":\"1644\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAwFJAAAAAAADAUkAAAAAAAKBUQAAAAAAAoFRAAAAAAABAVUAAAAAAAEBVQAAAAAAAgFZAAAAAAACAVkAAAAAAAGBYQAAAAAAAYFhA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABVVVVVVVXFP1VVVVVVVcU/VVVVVVVV1T9VVVVVVVXVPwAAAAAAAOA/AAAAAAAA4D9VVVVVVVXlP1VVVVVVVeU/q6qqqqqq6j+rqqqqqqrqPwAAAAAAAPA/\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"1736\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1735\",\"type\":\"UnionRenderers\"}},\"id\":\"1699\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1645\",\"type\":\"SaveTool\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#ff7e0e\"},\"line_width\":{\"value\":2},\"x\":{\"value\":97.5},\"y\":{\"value\":1}},\"id\":\"1739\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":97.5},\"y\":{\"value\":1}},\"id\":\"1740\",\"type\":\"Ray\"},{\"attributes\":{\"source\":{\"id\":\"1738\",\"type\":\"ColumnDataSource\"}},\"id\":\"1742\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"2008\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2007\",\"type\":\"UnionRenderers\"}},\"id\":\"1902\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1870\",\"type\":\"ColumnDataSource\"}},\"id\":\"1874\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1870\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1871\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1872\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1874\",\"type\":\"CDSView\"}},\"id\":\"1873\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1785\",\"type\":\"ColumnDataSource\"}},\"id\":\"1789\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1757\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1899\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1669\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1670\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1671\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1673\",\"type\":\"CDSView\"}},\"id\":\"1672\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1680\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1758\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1760\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1761\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1762\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1764\",\"type\":\"CDSView\"}},\"id\":\"1763\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#1f77b3\"},\"line_width\":{\"value\":2},\"x\":{\"value\":45.0},\"y\":{\"value\":0}},\"id\":\"1670\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1900\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1715\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1714\",\"type\":\"UnionRenderers\"}},\"id\":\"1683\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1903\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1904\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1681\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1762\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1902\",\"type\":\"ColumnDataSource\"}},\"id\":\"1906\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1902\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1903\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1904\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1906\",\"type\":\"CDSView\"}},\"id\":\"1905\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1760\",\"type\":\"ColumnDataSource\"}},\"id\":\"1764\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1781\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"1763\",\"type\":\"GlyphRenderer\"},{\"id\":\"1788\",\"type\":\"GlyphRenderer\"},{\"id\":\"1814\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1784\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1933\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1782\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1837\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1836\",\"type\":\"UnionRenderers\"}},\"id\":\"1785\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1934\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":55.0},\"y\":{\"value\":0}},\"id\":\"1786\",\"type\":\"Ray\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1867\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1866\",\"type\":\"UnionRenderers\"}},\"id\":\"1811\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_color\":{\"value\":\"#2ba02b\"},\"line_width\":{\"value\":2},\"x\":{\"value\":100.0},\"y\":{\"value\":1}},\"id\":\"1812\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":95.0},\"y\":{\"value\":1}},\"id\":\"1685\",\"type\":\"Ray\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":55.0},\"y\":{\"value\":0}},\"id\":\"1787\",\"type\":\"Ray\"},{\"attributes\":{},\"id\":\"1808\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1785\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1786\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1787\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1789\",\"type\":\"CDSView\"}},\"id\":\"1788\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":0},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":100.0},\"y\":{\"value\":1}},\"id\":\"1813\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1840\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1809\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1836\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1839\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1840\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1841\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1843\",\"type\":\"CDSView\"}},\"id\":\"1842\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1811\",\"type\":\"ColumnDataSource\"}},\"id\":\"1815\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1811\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1812\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1813\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1815\",\"type\":\"CDSView\"}},\"id\":\"1814\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1841\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1839\",\"type\":\"ColumnDataSource\"}},\"id\":\"1843\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1866\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"1842\",\"type\":\"GlyphRenderer\"},{\"id\":\"1873\",\"type\":\"GlyphRenderer\"},{\"id\":\"1905\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1869\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"1867\",\"type\":\"Selection\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_color\":{\"value\":\"#d62628\"},\"line_width\":{\"value\":2},\"x\":{\"value\":40.0},\"y\":{\"value\":0}},\"id\":\"1871\",\"type\":\"Ray\"},{\"attributes\":{\"data_source\":{\"id\":\"1683\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1684\",\"type\":\"Ray\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1685\",\"type\":\"Ray\"},\"selection_glyph\":null,\"view\":{\"id\":\"1687\",\"type\":\"CDSView\"}},\"id\":\"1686\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"angle\":{\"units\":\"rad\",\"value\":3.141592653589793},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x\":{\"value\":40.0},\"y\":{\"value\":0}},\"id\":\"1872\",\"type\":\"Ray\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1700\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{},\"selected\":{\"id\":\"1934\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1933\",\"type\":\"UnionRenderers\"}},\"id\":\"1870\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1623\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"11efe354-3c63-49fd-b502-1600f34927cd\",\"roots\":{\"1623\":\"3686602a-7bc8-4e16-9fab-e7ee3ec75a8b\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1623" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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 rightward from all other categories. This is most revealing in the ECDF." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Customization with Bokeh-catplot\n", "\n", "You may have noticed in the discussion of ECDFs that I introduced some new keyword arguments, `formal` and `p`. In fact, each of the four plotting functions also has the following additional optional keyword arguments.\n", "\n", "- `palette`: A list of hex colors to use for coloring the markers for each category. By default, it uses the default color scheme of [Vega-Lite](https://vega.github.io/vega-lite/).\n", "- `order`: If specified, the ordering of the categories to use on the categorical axis and legend (if applicable). Otherwise, the order of the inputted data frame is used.\n", "- `p`: If specified, the `bokeh.plotting.Figure` object to use for the plot. If not specified, a new figure is created.\n", "\n", "The respective plotting functions also have kwargs that are specific to each (such as `formal` for `bokeh_catplot.ecdf()`. Examples highlighting some, but not all, customizations follow. You can find out what kwargs are available for each function by reading their doc strings, e.g., with\n", "\n", "```python\n", "bokeh_catplot.box?\n", "```\n", "\n", "Any kwargs not in the function call signature are passed to `bokeh.plotting.figure()` when the figure is instantiated." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customizing box plots\n", "\n", "We can also have horizontal box plots. The `'horizontal` kwarg also works for strip plots." ] }, { "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 = {\"32e6bc25-cba5-4d34-898c-7b8170d07442\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2205\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"2209\",\"type\":\"Grid\"},{\"id\":\"2213\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"2210\",\"type\":\"CategoricalAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2235\",\"type\":\"GlyphRenderer\"},{\"id\":\"2240\",\"type\":\"GlyphRenderer\"},{\"id\":\"2245\",\"type\":\"GlyphRenderer\"},{\"id\":\"2250\",\"type\":\"GlyphRenderer\"},{\"id\":\"2255\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2331\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2220\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2198\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2201\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2196\",\"type\":\"FactorRange\"},\"y_scale\":{\"id\":\"2203\",\"type\":\"CategoricalScale\"}},\"id\":\"2197\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"}},\"id\":\"2246\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"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\":\"2338\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2337\",\"type\":\"UnionRenderers\"}},\"id\":\"2227\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2337\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2228\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2253\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2254\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"2256\",\"type\":\"CDSView\"}},\"id\":\"2255\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"2238\",\"type\":\"Segment\"},{\"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\":\"#1f77b4\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2249\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"2217\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"2234\",\"type\":\"Segment\"},{\"attributes\":{\"overlay\":{\"id\":\"2341\",\"type\":\"BoxAnnotation\"}},\"id\":\"2216\",\"type\":\"BoxZoomTool\"},{\"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\":\"2229\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2331\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2229\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2230\",\"type\":\"CategoricalColorMapper\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2253\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2215\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"}},\"id\":\"2236\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2231\",\"type\":\"CategoricalColorMapper\"}},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":null},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2243\",\"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\":\"2230\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"2206\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2254\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2214\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"2228\",\"type\":\"ColumnDataSource\"}},\"id\":\"2256\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2201\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"white\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2248\",\"type\":\"HBar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"2239\",\"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\":\"2231\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"2233\",\"type\":\"Segment\"},{\"attributes\":{\"source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"}},\"id\":\"2241\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"2333\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"2211\",\"type\":\"CategoricalTicker\"}},\"id\":\"2210\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"2244\",\"type\":\"HBar\"},{\"attributes\":{\"ticker\":{\"id\":\"2206\",\"type\":\"BasicTicker\"}},\"id\":\"2209\",\"type\":\"Grid\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":null,\"ticker\":{\"id\":\"2211\",\"type\":\"CategoricalTicker\"}},\"id\":\"2213\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2339\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"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\":\"2340\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2339\",\"type\":\"UnionRenderers\"}},\"id\":\"2228\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2333\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2338\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2211\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2340\",\"type\":\"Selection\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2214\",\"type\":\"PanTool\"},{\"id\":\"2215\",\"type\":\"WheelZoomTool\"},{\"id\":\"2216\",\"type\":\"BoxZoomTool\"},{\"id\":\"2217\",\"type\":\"SaveTool\"},{\"id\":\"2218\",\"type\":\"ResetTool\"},{\"id\":\"2219\",\"type\":\"HelpTool\"}]},\"id\":\"2220\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null},\"id\":\"2198\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"}},\"id\":\"2251\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2341\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2203\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2335\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2219\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2335\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2206\",\"type\":\"BasicTicker\"}},\"id\":\"2205\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2233\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2234\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"2236\",\"type\":\"CDSView\"}},\"id\":\"2235\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2218\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2238\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2239\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"2241\",\"type\":\"CDSView\"}},\"id\":\"2240\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2248\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2249\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2251\",\"type\":\"CDSView\"}},\"id\":\"2250\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2227\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2243\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2244\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2246\",\"type\":\"CDSView\"}},\"id\":\"2245\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"2196\",\"type\":\"FactorRange\"}],\"root_ids\":[\"2197\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"32e6bc25-cba5-4d34-898c-7b8170d07442\",\"roots\":{\"2197\":\"449ad934-6fea-4680-bd6e-f351924b3bba\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2197" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.box(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", " horizontal=True\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can independently specify properties of the marks using `box_kwargs`, `whisker_kwargs`, `median_kwargs`, and `outlier_kwargs`. For example, say we wanted our colors to be [Betancourt red](https://betanalpha.github.io/assets/case_studies/principled_bayesian_workflow.html#step_four:_build_a_generative_model19), and that we wanted the outliers to also be that color and use diamond glyphs." ] }, { "cell_type": "code", "execution_count": 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 = {\"25266406-a4cf-4e24-9303-49bb96792b98\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2417\",\"type\":\"CategoricalAxis\"}],\"center\":[{\"id\":\"2420\",\"type\":\"Grid\"},{\"id\":\"2425\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"2421\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2444\",\"type\":\"GlyphRenderer\"},{\"id\":\"2449\",\"type\":\"GlyphRenderer\"},{\"id\":\"2454\",\"type\":\"GlyphRenderer\"},{\"id\":\"2459\",\"type\":\"GlyphRenderer\"},{\"id\":\"2464\",\"type\":\"GlyphRenderer\"},{\"id\":\"2469\",\"type\":\"GlyphRenderer\"},{\"id\":\"2474\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2561\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2432\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2408\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"2413\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"2411\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2415\",\"type\":\"LinearScale\"}},\"id\":\"2409\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2563\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2422\",\"type\":\"BasicTicker\"}},\"id\":\"2421\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2450\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2448\",\"type\":\"Segment\"},{\"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\":\"2452\",\"type\":\"VBar\"},{\"attributes\":{\"bottom\":{\"field\":\"top_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"top_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2453\",\"type\":\"VBar\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2457\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2445\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":\"#7C0000\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2472\",\"type\":\"Diamond\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2426\",\"type\":\"PanTool\"},{\"id\":\"2427\",\"type\":\"WheelZoomTool\"},{\"id\":\"2428\",\"type\":\"BoxZoomTool\"},{\"id\":\"2429\",\"type\":\"SaveTool\"},{\"id\":\"2430\",\"type\":\"ResetTool\"},{\"id\":\"2431\",\"type\":\"HelpTool\"}]},\"id\":\"2432\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2473\",\"type\":\"Diamond\"},{\"attributes\":{\"data_source\":{\"id\":\"2440\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2472\",\"type\":\"Diamond\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2473\",\"type\":\"Diamond\"},\"selection_glyph\":null,\"view\":{\"id\":\"2475\",\"type\":\"CDSView\"}},\"id\":\"2474\",\"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\":\"2442\",\"type\":\"Segment\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom_whisker\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"top\":{\"field\":\"bottom_whisker\"},\"width\":{\"value\":0.1},\"x\":{\"field\":\"cat\"}},\"id\":\"2458\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2442\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2443\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"2445\",\"type\":\"CDSView\"}},\"id\":\"2444\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_color\":{\"value\":\"#7C0000\"},\"line_color\":{\"value\":null},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2462\",\"type\":\"VBar\"},{\"attributes\":{\"source\":{\"id\":\"2440\",\"type\":\"ColumnDataSource\"}},\"id\":\"2475\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2426\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2413\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2567\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2457\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2458\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2460\",\"type\":\"CDSView\"}},\"id\":\"2459\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2427\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2570\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"2408\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2467\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2468\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2470\",\"type\":\"CDSView\"}},\"id\":\"2469\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2563\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2460\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"2571\",\"type\":\"BoxAnnotation\"}},\"id\":\"2428\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2565\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2429\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2568\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null},\"id\":\"2411\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"top\"},\"y1\":{\"field\":\"top_whisker\"}},\"id\":\"2443\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"2569\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2455\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2465\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2430\",\"type\":\"ResetTool\"},{\"attributes\":{\"bottom\":{\"field\":\"bottom\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2463\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2462\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2463\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2465\",\"type\":\"CDSView\"}},\"id\":\"2464\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2571\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2431\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2452\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2453\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"2455\",\"type\":\"CDSView\"}},\"id\":\"2454\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2415\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2561\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"2565\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"2418\",\"type\":\"CategoricalTicker\"}},\"id\":\"2417\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"}},\"id\":\"2470\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2422\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_color\":{\"value\":\"#7C0000\"},\"line_width\":{\"value\":2},\"x0\":{\"field\":\"cat\"},\"x1\":{\"field\":\"cat\"},\"y0\":{\"field\":\"bottom\"},\"y1\":{\"field\":\"bottom_whisker\"}},\"id\":\"2447\",\"type\":\"Segment\"},{\"attributes\":{\"data_source\":{\"id\":\"2439\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2447\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2448\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"2450\",\"type\":\"CDSView\"}},\"id\":\"2449\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2418\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"callback\":null,\"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\":\"2568\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2567\",\"type\":\"UnionRenderers\"}},\"id\":\"2439\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2467\",\"type\":\"VBar\"},{\"attributes\":{\"grid_line_color\":null,\"ticker\":{\"id\":\"2418\",\"type\":\"CategoricalTicker\"}},\"id\":\"2420\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"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\":\"2570\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2569\",\"type\":\"UnionRenderers\"}},\"id\":\"2440\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom\":{\"field\":\"middle\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"middle\"},\"width\":{\"value\":0.4},\"x\":{\"field\":\"cat\"}},\"id\":\"2468\",\"type\":\"VBar\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"2422\",\"type\":\"BasicTicker\"}},\"id\":\"2425\",\"type\":\"Grid\"}],\"root_ids\":[\"2409\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"25266406-a4cf-4e24-9303-49bb96792b98\",\"roots\":{\"2409\":\"597f6f5f-66b1-4ca9-b7c2-16288cf1b17e\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2409" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.box(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", " whisker_caps=True,\n", " outlier_marker='diamond',\n", " box_kwargs=dict(fill_color='#7C0000'),\n", " whisker_kwargs=dict(line_color='#7C0000', line_width=2),\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Custominzing strip plots\n", "\n", "To help alleviate the overlap problem, we can make a strip plot with dash markers and add some transparency." ] }, { "cell_type": "code", "execution_count": 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 = {\"bb526b20-958e-46ed-97ee-ad0e63ba8f68\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2647\",\"type\":\"CategoricalAxis\"}],\"center\":[{\"id\":\"2650\",\"type\":\"Grid\"},{\"id\":\"2655\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"2651\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2674\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2772\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2662\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2638\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"2643\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"2641\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2645\",\"type\":\"LinearScale\"}},\"id\":\"2639\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"2670\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2672\",\"type\":\"Dash\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2673\",\"type\":\"Dash\"},\"selection_glyph\":null,\"view\":{\"id\":\"2675\",\"type\":\"CDSView\"}},\"id\":\"2674\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2659\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2660\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2661\",\"type\":\"HelpTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2780\",\"type\":\"BoxAnnotation\"}},\"id\":\"2658\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2779\",\"type\":\"Selection\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2656\",\"type\":\"PanTool\"},{\"id\":\"2657\",\"type\":\"WheelZoomTool\"},{\"id\":\"2658\",\"type\":\"BoxZoomTool\"},{\"id\":\"2659\",\"type\":\"SaveTool\"},{\"id\":\"2660\",\"type\":\"ResetTool\"},{\"id\":\"2661\",\"type\":\"HelpTool\"}]},\"id\":\"2662\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2652\",\"type\":\"BasicTicker\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2772\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2774\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2652\",\"type\":\"BasicTicker\"}},\"id\":\"2651\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"2638\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"2776\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"grid_line_color\":null,\"ticker\":{\"id\":\"2648\",\"type\":\"CategoricalTicker\"}},\"id\":\"2650\",\"type\":\"Grid\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"2652\",\"type\":\"BasicTicker\"}},\"id\":\"2655\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"2641\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"2670\",\"type\":\"ColumnDataSource\"}},\"id\":\"2675\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2778\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2657\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2774\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2780\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2643\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2656\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2648\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2669\",\"type\":\"CategoricalColorMapper\"}},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2669\",\"type\":\"CategoricalColorMapper\"}},\"size\":{\"units\":\"screen\",\"value\":25.0},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2672\",\"type\":\"Dash\"},{\"attributes\":{\"formatter\":{\"id\":\"2776\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"2648\",\"type\":\"CategoricalTicker\"}},\"id\":\"2647\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":25.0},\"x\":{\"field\":\"cat\"},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2673\",\"type\":\"Dash\"},{\"attributes\":{},\"id\":\"2645\",\"type\":\"LinearScale\"},{\"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\":\"2669\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"callback\":null,\"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\":\"2779\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2778\",\"type\":\"UnionRenderers\"}},\"id\":\"2670\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"2639\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"bb526b20-958e-46ed-97ee-ad0e63ba8f68\",\"roots\":{\"2639\":\"4e7ac999-13d6-4d83-b801-d81af56ca5f7\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2639" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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 wish 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": 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 = {\"496e3f79-af95-4a51-bd63-001ff1ca80fa\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2844\",\"type\":\"CategoricalAxis\"}],\"center\":[{\"id\":\"2847\",\"type\":\"Grid\"},{\"id\":\"2852\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"2848\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"2874\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2981\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2859\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2835\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"2840\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"2838\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2842\",\"type\":\"LinearScale\"}},\"id\":\"2836\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"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\":\"2988\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2987\",\"type\":\"UnionRenderers\"}},\"id\":\"2869\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2858\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"2870\",\"type\":\"Jitter\"}},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2873\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"2869\",\"type\":\"ColumnDataSource\"}},\"id\":\"2875\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"2869\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2872\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2873\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"2875\",\"type\":\"CDSView\"}},\"id\":\"2874\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"formatter\":{\"id\":\"2985\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"2845\",\"type\":\"CategoricalTicker\"}},\"id\":\"2844\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2849\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2845\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"grid_line_color\":null,\"ticker\":{\"id\":\"2845\",\"type\":\"CategoricalTicker\"}},\"id\":\"2847\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"age\",\"@{age}\"],[\"participant number\",\"@{participant number}\"]]},\"id\":\"2866\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"2988\",\"type\":\"Selection\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"2849\",\"type\":\"BasicTicker\"}},\"id\":\"2852\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"female\",\"insomniac\"],[\"female\",\"normal\"],[\"male\",\"insomniac\"],[\"male\",\"normal\"]]},\"id\":\"2835\",\"type\":\"FactorRange\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"2983\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2849\",\"type\":\"BasicTicker\"}},\"id\":\"2848\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"2838\",\"type\":\"DataRange1d\"},{\"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\":\"2868\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"2983\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2987\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2985\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"2835\",\"type\":\"FactorRange\"},\"width\":0.1},\"id\":\"2870\",\"type\":\"Jitter\"},{\"attributes\":{},\"id\":\"2840\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2853\",\"type\":\"PanTool\"},{\"id\":\"2854\",\"type\":\"WheelZoomTool\"},{\"id\":\"2855\",\"type\":\"BoxZoomTool\"},{\"id\":\"2856\",\"type\":\"SaveTool\"},{\"id\":\"2857\",\"type\":\"ResetTool\"},{\"id\":\"2858\",\"type\":\"HelpTool\"},{\"id\":\"2866\",\"type\":\"HoverTool\"}]},\"id\":\"2859\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2853\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2854\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2989\",\"type\":\"BoxAnnotation\"}},\"id\":\"2855\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2842\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2856\",\"type\":\"SaveTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2989\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2868\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"2868\",\"type\":\"CategoricalColorMapper\"}},\"x\":{\"field\":\"cat\",\"transform\":{\"id\":\"2870\",\"type\":\"Jitter\"}},\"y\":{\"field\":\"percent correct\"}},\"id\":\"2872\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2857\",\"type\":\"ResetTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2981\",\"type\":\"Title\"}],\"root_ids\":[\"2836\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"496e3f79-af95-4a51-bd63-001ff1ca80fa\",\"roots\":{\"2836\":\"2f959297-6556-471d-b62a-6be96768b36f\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2836" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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": [ "### Strip-box plots\n", "\n", "Even while plotting all of the data, we sometimes want to graphically display summary statistics, in which case overlaying a box plot and a jitter plot is useful. To populate an existing Bokeh figure with new glyphs from another catplot, pass in the `p` kwarg. You should be careful, though, because you need to make sure the `cats`, `val`, and `horizontal` arguments exactly match." ] }, { "cell_type": "code", "execution_count": 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 = {\"66adf552-9a62-4cf3-a88c-dca59bb6a9cd\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3053\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"3057\",\"type\":\"Grid\"},{\"id\":\"3061\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"3058\",\"type\":\"CategoricalAxis\"}],\"plot_height\":250,\"plot_width\":400,\"renderers\":[{\"id\":\"3081\",\"type\":\"GlyphRenderer\"},{\"id\":\"3089\",\"type\":\"GlyphRenderer\"},{\"id\":\"3094\",\"type\":\"GlyphRenderer\"},{\"id\":\"3099\",\"type\":\"GlyphRenderer\"},{\"id\":\"3104\",\"type\":\"GlyphRenderer\"},{\"id\":\"3109\",\"type\":\"GlyphRenderer\"},{\"id\":\"3114\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"3230\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3068\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3046\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"3049\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3044\",\"type\":\"FactorRange\"},\"y_scale\":{\"id\":\"3051\",\"type\":\"CategoricalScale\"}},\"id\":\"3045\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"overlay\":{\"id\":\"3240\",\"type\":\"BoxAnnotation\"}},\"id\":\"3064\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"3065\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"3049\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"middle\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3112\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"3066\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"3051\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"3093\",\"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\":\"3102\",\"type\":\"HBar\"},{\"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\":\"#1f77b4\"},\"right\":{\"field\":\"middle\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3113\",\"type\":\"HBar\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3112\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3113\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"3115\",\"type\":\"CDSView\"}},\"id\":\"3114\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3075\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"cat\",\"transform\":{\"id\":\"3075\",\"type\":\"CategoricalColorMapper\"}},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"3077\",\"type\":\"Jitter\"}}},\"id\":\"3079\",\"type\":\"Circle\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"3088\",\"type\":\"Segment\"},{\"attributes\":{},\"id\":\"3067\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3234\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"3054\",\"type\":\"BasicTicker\"}},\"id\":\"3053\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3095\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3100\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3097\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3098\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"3100\",\"type\":\"CDSView\"}},\"id\":\"3099\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"male\",\"normal\"],[\"male\",\"insomniac\"],[\"female\",\"normal\"],[\"female\",\"insomniac\"]]},\"id\":\"3044\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3092\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3093\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"3095\",\"type\":\"CDSView\"}},\"id\":\"3094\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"3076\",\"type\":\"ColumnDataSource\"}},\"id\":\"3082\",\"type\":\"CDSView\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":null,\"ticker\":{\"id\":\"3059\",\"type\":\"CategoricalTicker\"}},\"id\":\"3061\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3054\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"3054\",\"type\":\"BasicTicker\"}},\"id\":\"3057\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3115\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"3076\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3079\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3080\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3082\",\"type\":\"CDSView\"}},\"id\":\"3081\",\"type\":\"GlyphRenderer\"},{\"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\":\"3097\",\"type\":\"HBar\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3105\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3059\",\"type\":\"CategoricalTicker\"},{\"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\":\"#1f77b4\"},\"right\":{\"field\":\"bottom_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3103\",\"type\":\"HBar\"},{\"attributes\":{\"formatter\":{\"id\":\"3232\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"3059\",\"type\":\"CategoricalTicker\"}},\"id\":\"3058\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3102\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3103\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"3105\",\"type\":\"CDSView\"}},\"id\":\"3104\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3237\",\"type\":\"Selection\"},{\"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\":\"#1f77b4\"},\"right\":{\"field\":\"top_whisker\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3098\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"3238\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3240\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3110\",\"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\":\"3075\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"distribution\":\"normal\",\"range\":{\"id\":\"3044\",\"type\":\"FactorRange\"},\"width\":0.1},\"id\":\"3077\",\"type\":\"Jitter\"},{\"attributes\":{\"callback\":null,\"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\":\"3237\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3236\",\"type\":\"UnionRenderers\"}},\"id\":\"3076\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"}},\"id\":\"3090\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3062\",\"type\":\"PanTool\"},{\"id\":\"3063\",\"type\":\"WheelZoomTool\"},{\"id\":\"3064\",\"type\":\"BoxZoomTool\"},{\"id\":\"3065\",\"type\":\"SaveTool\"},{\"id\":\"3066\",\"type\":\"ResetTool\"},{\"id\":\"3067\",\"type\":\"HelpTool\"}]},\"id\":\"3068\",\"type\":\"Toolbar\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3230\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"value\":null},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_color\":{\"value\":\"gray\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3107\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"3239\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"cat\",\"transform\":{\"id\":\"3077\",\"type\":\"Jitter\"}}},\"id\":\"3080\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3236\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3087\",\"type\":\"Segment\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3088\",\"type\":\"Segment\"},\"selection_glyph\":null,\"view\":{\"id\":\"3090\",\"type\":\"CDSView\"}},\"id\":\"3089\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3234\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.4},\"left\":{\"field\":\"bottom\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"top\"},\"y\":{\"field\":\"cat\"}},\"id\":\"3108\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"3062\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"3084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3107\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3108\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"3110\",\"type\":\"CDSView\"}},\"id\":\"3109\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"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\":\"3239\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3238\",\"type\":\"UnionRenderers\"}},\"id\":\"3084\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3063\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"3046\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"3232\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"top\"},\"x1\":{\"field\":\"top_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"3087\",\"type\":\"Segment\"},{\"attributes\":{\"line_color\":{\"value\":\"gray\"},\"x0\":{\"field\":\"bottom\"},\"x1\":{\"field\":\"bottom_whisker\"},\"y0\":{\"field\":\"cat\"},\"y1\":{\"field\":\"cat\"}},\"id\":\"3092\",\"type\":\"Segment\"}],\"root_ids\":[\"3045\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"66adf552-9a62-4cf3-a88c-dca59bb6a9cd\",\"roots\":{\"3045\":\"f25ba8f4-7e12-430d-82e4-9ea06b3788dc\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "3045" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.strip(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", " horizontal=True,\n", " jitter=True,\n", " height=250\n", ")\n", "\n", "p = bokeh_catplot.box(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", " horizontal=True,\n", " whisker_caps=True,\n", " display_points=False,\n", " box_kwargs=dict(fill_color=None, line_color='gray'),\n", " median_kwargs=dict(line_color='gray'),\n", " whisker_kwargs=dict(line_color='gray'),\n", " p=p,\n", ")\n", "\n", "bokeh.io.show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customizing histograms\n", "\n", "We could plot normalized histograms using the density kwarg, 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 = {\"d830a968-8c1b-40e4-acee-837aefb14e22\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3316\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"3320\",\"type\":\"Grid\"},{\"id\":\"3325\",\"type\":\"Grid\"},{\"id\":\"3351\",\"type\":\"Legend\"}],\"left\":[{\"id\":\"3321\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":550,\"renderers\":[{\"id\":\"3342\",\"type\":\"GlyphRenderer\"},{\"id\":\"3356\",\"type\":\"GlyphRenderer\"},{\"id\":\"3370\",\"type\":\"GlyphRenderer\"},{\"id\":\"3387\",\"type\":\"GlyphRenderer\"},{\"id\":\"3405\",\"type\":\"GlyphRenderer\"},{\"id\":\"3426\",\"type\":\"GlyphRenderer\"},{\"id\":\"3448\",\"type\":\"GlyphRenderer\"},{\"id\":\"3473\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"3344\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3332\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3309\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"3312\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3307\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"3314\",\"type\":\"LinearScale\"}},\"id\":\"3308\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"3330\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"3326\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"3380\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3326\",\"type\":\"PanTool\"},{\"id\":\"3327\",\"type\":\"WheelZoomTool\"},{\"id\":\"3328\",\"type\":\"BoxZoomTool\"},{\"id\":\"3329\",\"type\":\"SaveTool\"},{\"id\":\"3330\",\"type\":\"ResetTool\"},{\"id\":\"3331\",\"type\":\"HelpTool\"}]},\"id\":\"3332\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3425\",\"type\":\"Patch\"},{\"attributes\":{\"axis_label\":\"density\",\"formatter\":{\"id\":\"3346\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"3322\",\"type\":\"BasicTicker\"}},\"id\":\"3321\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3322\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3381\",\"type\":\"Selection\"},{\"attributes\":{\"ticker\":{\"id\":\"3317\",\"type\":\"BasicTicker\"}},\"id\":\"3320\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3346\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"3470\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3471\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3472\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"3474\",\"type\":\"CDSView\"}},\"id\":\"3473\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3317\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"3322\",\"type\":\"BasicTicker\"}},\"id\":\"3325\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":\"#d62628\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3446\",\"type\":\"Line\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3348\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"3317\",\"type\":\"BasicTicker\"}},\"id\":\"3316\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":\"#1f77b3\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3340\",\"type\":\"Line\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#1f77b3\",\"line_alpha\":0,\"line_color\":\"#1f77b3\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3354\",\"type\":\"Patch\"},{\"attributes\":{\"overlay\":{\"id\":\"3350\",\"type\":\"BoxAnnotation\"}},\"id\":\"3328\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"3309\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"3312\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3314\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3365\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdAAAAAAADAV0AAAAAAAIBGQA==\",\"dtype\":\"float64\",\"shape\":[14]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADtWIEw0o6FP+1YgTDSjoU/7ViBMNKOhT/tWIEw0o6FP7ICYaQdK6A/sgJhpB0roD/tWIEw0o6VP+1YgTDSjpU/KK+hvIbymj8or6G8hvKaPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[14]}},\"selected\":{\"id\":\"3381\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3380\",\"type\":\"UnionRenderers\"}},\"id\":\"3353\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3353\",\"type\":\"ColumnDataSource\"}},\"id\":\"3357\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3355\",\"type\":\"Patch\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#ff7e0e\",\"line_alpha\":0,\"line_color\":\"#ff7e0e\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3385\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"3327\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"3364\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"3370\",\"type\":\"GlyphRenderer\"},{\"id\":\"3387\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3383\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUA=\",\"dtype\":\"float64\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABfEQgWgWCBP18RCBaBYIE/1MEKyFYrhz/UwQrIViuHP1tyDXos9ow/W3INeiz2jD83cg16LPacPzdyDXos9pw/l8oOU5fbnz+Xyg5Tl9ufP9TBCshWK6c/1MEKyFYrpz9fEQgWgWCRP18RCBaBYJE/AAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[16]}},\"selected\":{\"id\":\"3443\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3442\",\"type\":\"UnionRenderers\"}},\"id\":\"3402\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"3353\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3354\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3355\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"3357\",\"type\":\"CDSView\"}},\"id\":\"3356\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":\"#ff7e0e\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3368\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"3342\",\"type\":\"GlyphRenderer\"},{\"id\":\"3356\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3352\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"3470\",\"type\":\"ColumnDataSource\"}},\"id\":\"3474\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"3448\",\"type\":\"GlyphRenderer\"},{\"id\":\"3473\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3469\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3472\",\"type\":\"Patch\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3369\",\"type\":\"Line\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3344\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"3367\",\"type\":\"ColumnDataSource\"}},\"id\":\"3371\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#d62628\",\"line_alpha\":0,\"line_color\":\"#d62628\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3471\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"3329\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"3466\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACARkAAAAAAAIBGQAAAAAAAgEtAAAAAAACAS0AAAAAAAEBQQAAAAAAAQFBAAAAAAADAUkAAAAAAAMBSQAAAAAAAQFVAAAAAAABAVUAAAAAAAMBXQAAAAAAAwFdA\",\"dtype\":\"float64\",\"shape\":[12]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADtWIEw0o6FP+1YgTDSjoU/7ViBMNKOhT/tWIEw0o6FP7ICYaQdK6A/sgJhpB0roD/tWIEw0o6VP+1YgTDSjpU/KK+hvIbymj8or6G8hvKaPwAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[12]}},\"selected\":{\"id\":\"3365\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3364\",\"type\":\"UnionRenderers\"}},\"id\":\"3339\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3445\",\"type\":\"ColumnDataSource\"}},\"id\":\"3449\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAACAS0AAAAAAAIBLQG7btm3btk5Abtu2bdu2TkBu27Zt2/ZQQG7btm3b9lBAJEmSJEmSUkAkSZIkSZJSQNy2bdu2LVRA3LZt27YtVECSJEmSJMlVQJIkSZIkyVVASZIkSZJkV0BJkiRJkmRXQAAAAAAAAFlAAAAAAAAAWUAAAAAAAABZQAAAAAAAgEtA\",\"dtype\":\"float64\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAABfEQgWgWCBP18RCBaBYIE/1MEKyFYrhz/UwQrIViuHP1tyDXos9ow/W3INeiz2jD83cg16LPacPzdyDXos9pw/l8oOU5fbnz+Xyg5Tl9ufP9TBCshWK6c/1MEKyFYrpz9fEQgWgWCRP18RCBaBYJE/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[18]}},\"selected\":{\"id\":\"3467\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3466\",\"type\":\"UnionRenderers\"}},\"id\":\"3423\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"3339\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3340\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3341\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3343\",\"type\":\"CDSView\"}},\"id\":\"3342\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"3352\",\"type\":\"LegendItem\"},{\"id\":\"3383\",\"type\":\"LegendItem\"},{\"id\":\"3422\",\"type\":\"LegendItem\"},{\"id\":\"3469\",\"type\":\"LegendItem\"}],\"location\":\"top_left\"},\"id\":\"3351\",\"type\":\"Legend\"},{\"attributes\":{\"line_color\":\"#2ba02b\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3403\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"3442\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3420\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3404\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQA==\",\"dtype\":\"float64\",\"shape\":[8]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAARERERERGhPxEREREREaE/ERERERERoT8RERERERGhPxEREREREaE/ERERERERoT8AAAAAAAAAAA==\",\"dtype\":\"float64\",\"shape\":[8]}},\"selected\":{\"id\":\"3400\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3399\",\"type\":\"UnionRenderers\"}},\"id\":\"3367\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3493\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"3384\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3385\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3386\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"3388\",\"type\":\"CDSView\"}},\"id\":\"3387\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3443\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3641\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"3445\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3446\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3447\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3449\",\"type\":\"CDSView\"}},\"id\":\"3448\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3348\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3350\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"3367\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3368\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3369\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3371\",\"type\":\"CDSView\"}},\"id\":\"3370\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3419\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3467\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"3307\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAADgUEAAAAAAAOBQQAAAAAAAYFNAAAAAAABgU0AAAAAAAOBVQAAAAAAA4FVAAAAAAABgWEAAAAAAAGBYQAAAAAAAYFhAAAAAAADgUEA=\",\"dtype\":\"float64\",\"shape\":[10]},\"y\":{\"__ndarray__\":\"AAAAAAAAAAARERERERGhPxEREREREaE/ERERERERoT8RERERERGhPxEREREREaE/ERERERERoT8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[10]}},\"selected\":{\"id\":\"3420\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3419\",\"type\":\"UnionRenderers\"}},\"id\":\"3384\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#1f77b4\",\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3386\",\"type\":\"Patch\"},{\"attributes\":{\"data_source\":{\"id\":\"3402\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3403\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3404\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3406\",\"type\":\"CDSView\"}},\"id\":\"3405\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"3423\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3424\",\"type\":\"Patch\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3425\",\"type\":\"Patch\"},\"selection_glyph\":null,\"view\":{\"id\":\"3427\",\"type\":\"CDSView\"}},\"id\":\"3426\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":0.3,\"fill_color\":\"#2ba02b\",\"line_alpha\":0,\"line_color\":\"#2ba02b\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3424\",\"type\":\"Patch\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0A=\",\"dtype\":\"float64\",\"shape\":[16]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADMdNxjJLJ3P8x03GMksnc/AAAAAAAAAAAAAAAAAAAAAMx03GMksnc/zHTcYySydz/GdNxjJLJ3P8Z03GMksnc/nlflSpvFoT+eV+VKm8WhP/eR03ytnp0/95HTfK2enT/GdNxjJLKnP8Z03GMksqc/AAAAAAAAAAA=\",\"dtype\":\"float64\",\"shape\":[16]}},\"selected\":{\"id\":\"3494\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3493\",\"type\":\"UnionRenderers\"}},\"id\":\"3445\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3331\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"3494\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"3423\",\"type\":\"ColumnDataSource\"}},\"id\":\"3427\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3400\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3399\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAREAAAAAAAABEQNu2bdu27UdA27Zt27btR0C3bdu2bdtLQLdt27Zt20tAkiRJkiTJT0CSJEmSJMlPQLdt27Zt21FAt23btm3bUUAkSZIkSdJTQCRJkiRJ0lNAkiRJkiTJVUCSJEmSJMlVQAAAAAAAwFdAAAAAAADAV0AAAAAAAMBXQAAAAAAAAERA\",\"dtype\":\"float64\",\"shape\":[18]},\"y\":{\"__ndarray__\":\"AAAAAAAAAADMdNxjJLJ3P8x03GMksnc/AAAAAAAAAAAAAAAAAAAAAMx03GMksnc/zHTcYySydz/GdNxjJLJ3P8Z03GMksnc/nlflSpvFoT+eV+VKm8WhP/eR03ytnp0/95HTfK2enT/GdNxjJLKnP8Z03GMksqc/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"dtype\":\"float64\",\"shape\":[18]}},\"selected\":{\"id\":\"3642\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3641\",\"type\":\"UnionRenderers\"}},\"id\":\"3470\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3341\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"3642\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"3384\",\"type\":\"ColumnDataSource\"}},\"id\":\"3388\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"3339\",\"type\":\"ColumnDataSource\"}},\"id\":\"3343\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3447\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"3402\",\"type\":\"ColumnDataSource\"}},\"id\":\"3406\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"3405\",\"type\":\"GlyphRenderer\"},{\"id\":\"3426\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3422\",\"type\":\"LegendItem\"}],\"root_ids\":[\"3308\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"d830a968-8c1b-40e4-acee-837aefb14e22\",\"roots\":{\"3308\":\"0d5180f4-0893-41a4-b007-aabceb1e2984\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "3308" } }, "output_type": "display_data" } ], "source": [ "# Plot the histogram\n", "p = bokeh_catplot.histogram(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\n", " density=True,\n", " width=550,\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 = {\"5a31296f-76d0-4335-b8e4-db603ab89287\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3791\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"3795\",\"type\":\"Grid\"},{\"id\":\"3800\",\"type\":\"Grid\"},{\"id\":\"3827\",\"type\":\"Legend\"}],\"left\":[{\"id\":\"3796\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":400,\"renderers\":[{\"id\":\"3818\",\"type\":\"GlyphRenderer\"},{\"id\":\"3833\",\"type\":\"GlyphRenderer\"},{\"id\":\"3849\",\"type\":\"GlyphRenderer\"},{\"id\":\"3867\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"3820\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3807\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3783\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"3787\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3785\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"3789\",\"type\":\"LinearScale\"}},\"id\":\"3782\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3832\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"3845\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3847\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3848\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3850\",\"type\":\"CDSView\"}},\"id\":\"3849\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#d62628\"},\"line_color\":{\"value\":\"#d62628\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3865\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3859\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3860\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null},\"id\":\"3785\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"3829\",\"type\":\"ColumnDataSource\"}},\"id\":\"3834\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"3863\",\"type\":\"ColumnDataSource\"}},\"id\":\"3868\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"data\":{\"__ECDF\":{\"__ndarray__\":\"3dzc3NzczD9LS0tLS0vrP7W0tLS0tOQ/FBQUFBQUtD8eHh4eHh6eP8nIyMjIyOg/MjIyMjIy0j+XlpaWlpa2P319fX19fe0/+/r6+vr62j+cm5ubm5vbPx4eHh4eHr4/VVVVVVVVxT+XlpaWlpbGPzw8PDw8PNw/2NfX19fXxz8FBQUFBQXlPxQUFBQUFJQ/GRkZGRkZyT8=\",\"dtype\":\"float64\",\"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\",\"shape\":[19]},\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\"]},\"selected\":{\"id\":\"3842\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3841\",\"type\":\"UnionRenderers\"}},\"id\":\"3814\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3801\",\"type\":\"PanTool\"},{\"id\":\"3802\",\"type\":\"WheelZoomTool\"},{\"id\":\"3803\",\"type\":\"BoxZoomTool\"},{\"id\":\"3804\",\"type\":\"SaveTool\"},{\"id\":\"3805\",\"type\":\"ResetTool\"},{\"id\":\"3806\",\"type\":\"HelpTool\"}]},\"id\":\"3807\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"3814\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3816\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3817\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3819\",\"type\":\"CDSView\"}},\"id\":\"3818\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"3863\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3865\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3866\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3868\",\"type\":\"CDSView\"}},\"id\":\"3867\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"3814\",\"type\":\"ColumnDataSource\"}},\"id\":\"3819\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"3841\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3817\",\"type\":\"Circle\"},{\"attributes\":{\"label\":{\"value\":\"female, insomniac\"},\"renderers\":[{\"id\":\"3818\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3828\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"male, insomniac\"},\"renderers\":[{\"id\":\"3833\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3844\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"3801\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"3829\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3831\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3832\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"3834\",\"type\":\"CDSView\"}},\"id\":\"3833\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3842\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"3845\",\"type\":\"ColumnDataSource\"}},\"id\":\"3850\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3866\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3802\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"3797\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_color\":{\"value\":\"#ff7e0e\"},\"line_color\":{\"value\":\"#ff7e0e\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3831\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"3826\",\"type\":\"BoxAnnotation\"}},\"id\":\"3803\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"__ECDF\":{\"__ndarray__\":\"GRkZGRkZ6T/x8PDw8PDgP1VVVVVVVdU/7Ovr6+vr6z8ZGRkZGRmpPx4eHh4eHu4/9vX19fX11T99fX19fX3dP42MjIyMjOw/FBQUFBQUxD9QUFBQUFDQP5KRkZGRkeE/Hh4eHh4e3j83Nzc3NzfXP9jX19fX19c/FBQUFBQUhD+Ih4eHh4fnP2RkZGRkZOQ/kpGRkZGR0T+rqqqqqqrqP/v6+vr6+uo/2NfX19fX5z8=\",\"dtype\":\"float64\",\"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\",\"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\":\"4044\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4043\",\"type\":\"UnionRenderers\"}},\"id\":\"3863\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"#2ba02b\"},\"line_color\":{\"value\":\"#2ba02b\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3847\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3804\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b3\"},\"line_color\":{\"value\":\"#1f77b3\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3816\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3787\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"3820\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"3805\",\"type\":\"ResetTool\"},{\"attributes\":{\"click_policy\":\"hide\",\"items\":[{\"id\":\"3828\",\"type\":\"LegendItem\"},{\"id\":\"3844\",\"type\":\"LegendItem\"},{\"id\":\"3862\",\"type\":\"LegendItem\"},{\"id\":\"3882\",\"type\":\"LegendItem\"}],\"location\":\"top_left\"},\"id\":\"3827\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"3824\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"percent correct\"},\"y\":{\"field\":\"__ECDF\"}},\"id\":\"3848\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3806\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"3879\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3789\",\"type\":\"LinearScale\"},{\"attributes\":{\"label\":{\"value\":\"male, normal\"},\"renderers\":[{\"id\":\"3867\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3882\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"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\",\"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\",\"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\":\"3880\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3879\",\"type\":\"UnionRenderers\"}},\"id\":\"3845\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3822\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3880\",\"type\":\"Selection\"},{\"attributes\":{\"axis_label\":\"percent correct\",\"formatter\":{\"id\":\"3824\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"3792\",\"type\":\"BasicTicker\"}},\"id\":\"3791\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4043\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"3797\",\"type\":\"BasicTicker\"}},\"id\":\"3800\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3826\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"3792\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"3783\",\"type\":\"DataRange1d\"},{\"attributes\":{\"ticker\":{\"id\":\"3792\",\"type\":\"BasicTicker\"}},\"id\":\"3795\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4044\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"female, normal\"},\"renderers\":[{\"id\":\"3849\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3862\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"__ECDF\":{\"__ndarray__\":\"eHh4eHh46D9fX19fX1/fP5KRkZGRkcE/UFBQUFBQ4D/T0tLS0tLSP7++vr6+vu4/\",\"dtype\":\"float64\",\"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\",\"shape\":[6]},\"sleeper\":[\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\",\"insomniac\"]},\"selected\":{\"id\":\"3860\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3859\",\"type\":\"UnionRenderers\"}},\"id\":\"3829\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"ECDF\",\"formatter\":{\"id\":\"3822\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"3797\",\"type\":\"BasicTicker\"}},\"id\":\"3796\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"3782\"]},\"title\":\"Bokeh Application\",\"version\":\"1.3.4\"}};\n", " var render_items = [{\"docid\":\"5a31296f-76d0-4335-b8e4-db603ab89287\",\"roots\":{\"3782\":\"d05f9f6d-4ffd-4885-80b1-feb66d0b3c9d\"}}];\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", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "3782" } }, "output_type": "display_data" } ], "source": [ "p = bokeh_catplot.ecdf(\n", " data=df,\n", " cats=['gender', 'sleeper'],\n", " val='percent correct',\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 cumstomization, the doc strings of the respective plotting functions provide a good sense of 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.7.4\n", "IPython 7.8.0\n", "\n", "pandas 0.24.2\n", "bokeh 1.3.4\n", "bokeh_catplot 0.1.4\n", "jupyterlab 1.1.4\n" ] } ], "source": [ "%load_ext watermark\n", "\n", "%watermark -v -p pandas,bokeh,bokeh_catplot,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.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }