{ "cells": [ { "cell_type": "code", "execution_count": 2, "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 !== undefined) {\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 element_id = msg.content.text.trim();\n", " Bokeh.index[element_id].model.document.clear();\n", " delete Bokeh.index[element_id];\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[0].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[0].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[0]);\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(\"06736a46-a747-4610-8aac-b10928fd751e\");\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) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"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.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };var element = document.getElementById(\"06736a46-a747-4610-8aac-b10928fd751e\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid '06736a46-a747-4610-8aac-b10928fd751e' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n", " }\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(\"06736a46-a747-4610-8aac-b10928fd751e\")).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.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(js_urls, function() {\n", " console.log(\"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(\"06736a46-a747-4610-8aac-b10928fd751e\");\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) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.log(\"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.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = js_urls.length;\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var s = document.createElement('script');\n s.src = url;\n s.async = false;\n s.onreadystatechange = s.onload = function() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: all BokehJS libraries loaded\");\n run_callbacks()\n }\n };\n s.onerror = function() {\n console.warn(\"failed to load library \" + url);\n };\n console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n }\n };var element = document.getElementById(\"06736a46-a747-4610-8aac-b10928fd751e\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid '06736a46-a747-4610-8aac-b10928fd751e' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n }\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(\"06736a46-a747-4610-8aac-b10928fd751e\")).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.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(js_urls, function() {\n console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"04a7f69c-47f0-4cf8-a475-321be63bfbc7\":{\"roots\":{\"references\":[{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":4},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"432f0108-21aa-4f56-af33-addb99247425\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"a98360da-b3dc-4e59-a14a-0775af70a780\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"d2866814-0234-4b27-b1bb-d2b5cd10ecf4\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"fba75cf0-409f-4fbf-a687-f8c80dd8c7bd\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"8d2a582d-caab-41eb-b5cc-3d9fdf8fbadd\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"8d2a582d-caab-41eb-b5cc-3d9fdf8fbadd\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b87c9bb6-bea6-4f36-a0bd-e6132f5b93ec\",\"type\":\"BasicTicker\"}},\"id\":\"04e0e4f4-0078-4c10-b2c8-4a478687cdbe\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"b87c9bb6-bea6-4f36-a0bd-e6132f5b93ec\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b87c9bb6-bea6-4f36-a0bd-e6132f5b93ec\",\"type\":\"BasicTicker\"}},\"id\":\"e0790d59-0fc9-4cf5-bec8-7bf47fee334d\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"b13d8147-893d-4817-a354-5b0398aeb134\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"086279bf-1f60-4341-85bb-c813c712d69a\",\"type\":\"BasicTicker\"}},\"id\":\"1c027e91-aa39-42f7-a891-e87a6e6d0a15\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"086279bf-1f60-4341-85bb-c813c712d69a\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"086279bf-1f60-4341-85bb-c813c712d69a\",\"type\":\"BasicTicker\"}},\"id\":\"c32eb018-f42e-4f4b-8220-808045497dd1\",\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"77787025-e98b-4b2b-9296-e44a6044d91e\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"9c9c61c1-e885-468d-aaa8-f962abbb0f32\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"9277819d-5474-4fc1-b4f1-6e88de9b70f2\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"77787025-e98b-4b2b-9296-e44a6044d91e\",\"type\":\"BoxAnnotation\"}},\"id\":\"06418539-0583-4906-bf28-88a4b19f333f\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"6794efdf-d824-4546-9261-ba73ecf79609\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"fad30556-a685-463e-bc38-ad7a0cd9b632\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"a69dd8a8-88f8-4ffb-bd98-aab6f89f51b4\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"48cf4731-d7a3-4446-8a79-2bc5b31ff9fd\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"b13d8147-893d-4817-a354-5b0398aeb134\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1,2],\"y\":[1,2,3]}},\"id\":\"59add0a5-6cf9-4868-aa61-08135228f56d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"59add0a5-6cf9-4868-aa61-08135228f56d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d32ae94b-fe03-435a-a29a-e82b6b0261e1\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"432f0108-21aa-4f56-af33-addb99247425\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"5b5b83e1-8e0f-4b1d-8c41-e7b81bc1b09c\",\"type\":\"CDSView\"}},\"id\":\"683af307-6cd7-41db-96bd-3d63735f3e90\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"04e0e4f4-0078-4c10-b2c8-4a478687cdbe\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1c027e91-aa39-42f7-a891-e87a6e6d0a15\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"04e0e4f4-0078-4c10-b2c8-4a478687cdbe\",\"type\":\"LinearAxis\"},{\"id\":\"e0790d59-0fc9-4cf5-bec8-7bf47fee334d\",\"type\":\"Grid\"},{\"id\":\"1c027e91-aa39-42f7-a891-e87a6e6d0a15\",\"type\":\"LinearAxis\"},{\"id\":\"c32eb018-f42e-4f4b-8220-808045497dd1\",\"type\":\"Grid\"},{\"id\":\"77787025-e98b-4b2b-9296-e44a6044d91e\",\"type\":\"BoxAnnotation\"},{\"id\":\"683af307-6cd7-41db-96bd-3d63735f3e90\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"d2866814-0234-4b27-b1bb-d2b5cd10ecf4\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"b36e6fd9-3200-4276-a9e9-51253f507da5\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"48cf4731-d7a3-4446-8a79-2bc5b31ff9fd\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"5dcc87ef-dc6b-4a19-8576-931aab6da8fd\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"fba75cf0-409f-4fbf-a687-f8c80dd8c7bd\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"a98360da-b3dc-4e59-a14a-0775af70a780\",\"type\":\"LinearScale\"}},\"id\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"9c9c61c1-e885-468d-aaa8-f962abbb0f32\",\"type\":\"PanTool\"},{\"id\":\"9277819d-5474-4fc1-b4f1-6e88de9b70f2\",\"type\":\"WheelZoomTool\"},{\"id\":\"06418539-0583-4906-bf28-88a4b19f333f\",\"type\":\"BoxZoomTool\"},{\"id\":\"6794efdf-d824-4546-9261-ba73ecf79609\",\"type\":\"SaveTool\"},{\"id\":\"fad30556-a685-463e-bc38-ad7a0cd9b632\",\"type\":\"ResetTool\"},{\"id\":\"a69dd8a8-88f8-4ffb-bd98-aab6f89f51b4\",\"type\":\"HelpTool\"}]},\"id\":\"b36e6fd9-3200-4276-a9e9-51253f507da5\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"59add0a5-6cf9-4868-aa61-08135228f56d\",\"type\":\"ColumnDataSource\"}},\"id\":\"5b5b83e1-8e0f-4b1d-8c41-e7b81bc1b09c\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5dcc87ef-dc6b-4a19-8576-931aab6da8fd\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":4},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d32ae94b-fe03-435a-a29a-e82b6b0261e1\",\"type\":\"Line\"}],\"root_ids\":[\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"04a7f69c-47f0-4cf8-a475-321be63bfbc7\",\"elementid\":\"637baaa4-626d-4800-93e7-610e7b3c4061\",\"modelid\":\"53ec9e0d-b59d-4e77-bdec-3edd1181fdb0\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "53ec9e0d-b59d-4e77-bdec-3edd1181fdb0" } }, "output_type": "display_data" } ], "source": [ "from bokeh.plotting import figure, output_notebook, show\n", "\n", "output_notebook()\n", "p = figure(plot_width=200, plot_height=200)\n", "p.line([0, 1, 2], [1, 2, 3], line_width=4)\n", "\n", "show(p) #線の太さの設定" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"37563164-e29a-4c05-9f5d-d47a1bbb30e3\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null},\"id\":\"8960d723-54bf-445c-8c40-a42cc7c4e29f\",\"type\":\"DataRange1d\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"99b66f42-7743-4819-8beb-88cc734df7e8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"eff65350-ad6d-4b2b-8881-661324d6d41a\",\"type\":\"BasicTicker\"}},\"id\":\"6e28c045-48c0-4e08-aec7-26df7ee6ea6f\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"73e1ed5e-9df2-4547-b9c7-4a9a32f7bd44\",\"type\":\"BoxAnnotation\"}},\"id\":\"6522d78d-b341-458d-92b7-fb23d6e9db45\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"c707f5fc-6129-41f9-9f84-b2e72c43f7c2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":4},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d5a067f0-7e33-477b-a8d6-f39716dc0a8d\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"99b66f42-7743-4819-8beb-88cc734df7e8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"16d156d3-a9cf-4c0f-be89-a32d47aece9d\",\"type\":\"BasicTicker\"}},\"id\":\"d9a60e07-4e5e-40f6-9c40-813749cb60b2\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4cf0104f-bca1-4851-8aa0-5bead1f39a57\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"below\":[{\"id\":\"aa2102ee-b30c-460b-aa41-ac4e1efdeb5e\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"540e6aa3-3089-48a6-a3d4-937db25aad2d\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"aa2102ee-b30c-460b-aa41-ac4e1efdeb5e\",\"type\":\"LinearAxis\"},{\"id\":\"d9a60e07-4e5e-40f6-9c40-813749cb60b2\",\"type\":\"Grid\"},{\"id\":\"540e6aa3-3089-48a6-a3d4-937db25aad2d\",\"type\":\"LinearAxis\"},{\"id\":\"6e28c045-48c0-4e08-aec7-26df7ee6ea6f\",\"type\":\"Grid\"},{\"id\":\"73e1ed5e-9df2-4547-b9c7-4a9a32f7bd44\",\"type\":\"BoxAnnotation\"},{\"id\":\"69e3497e-b6c2-406e-a277-6a8b25f02ac0\",\"type\":\"GlyphRenderer\"},{\"id\":\"8f916fd1-5ae5-47ba-99ea-9851c1743880\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"ec154e5f-fc60-4e8c-99d7-59e52ba10055\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"fd024862-543c-41af-a8a5-ce47ba8829e2\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"0afb1057-c4c3-4cbc-a81f-ab728b6b3e8e\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"b9520bc7-f125-4fb7-a930-de3789cf182c\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"8960d723-54bf-445c-8c40-a42cc7c4e29f\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"fecc3884-9acd-4ae3-b958-bd50cfebc265\",\"type\":\"LinearScale\"}},\"id\":\"99b66f42-7743-4819-8beb-88cc734df7e8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"formatter\":{\"id\":\"c707f5fc-6129-41f9-9f84-b2e72c43f7c2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"99b66f42-7743-4819-8beb-88cc734df7e8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"16d156d3-a9cf-4c0f-be89-a32d47aece9d\",\"type\":\"BasicTicker\"}},\"id\":\"aa2102ee-b30c-460b-aa41-ac4e1efdeb5e\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"0afb1057-c4c3-4cbc-a81f-ab728b6b3e8e\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_color\":{\"value\":\"red\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1d6dfd7a-e0c9-492d-8b55-13e7b231e3cd\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"583c9b03-b704-4423-b137-a09c3ffe081d\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"fecc3884-9acd-4ae3-b958-bd50cfebc265\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"b9520bc7-f125-4fb7-a930-de3789cf182c\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"ebadab61-3b25-4cdb-828c-1885096e7432\",\"type\":\"SaveTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4c89cc99-f072-4e5c-9a68-d60cf66c6608\",\"type\":\"PanTool\"},{\"id\":\"583c9b03-b704-4423-b137-a09c3ffe081d\",\"type\":\"WheelZoomTool\"},{\"id\":\"6522d78d-b341-458d-92b7-fb23d6e9db45\",\"type\":\"BoxZoomTool\"},{\"id\":\"ebadab61-3b25-4cdb-828c-1885096e7432\",\"type\":\"SaveTool\"},{\"id\":\"d9d360c9-979d-49fb-a323-472cfe713704\",\"type\":\"ResetTool\"},{\"id\":\"5f7c8644-3a82-448e-a096-e8314d54b0dc\",\"type\":\"HelpTool\"}]},\"id\":\"fd024862-543c-41af-a8a5-ce47ba8829e2\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"12d77393-4673-49ce-9a1d-5b6eecde42b3\",\"type\":\"ColumnDataSource\"}},\"id\":\"6e7caadd-bd28-44cc-8930-08cad82d6d02\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1,2],\"y\":[1,2,3]}},\"id\":\"12d77393-4673-49ce-9a1d-5b6eecde42b3\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"16d156d3-a9cf-4c0f-be89-a32d47aece9d\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4c89cc99-f072-4e5c-9a68-d60cf66c6608\",\"type\":\"PanTool\"},{\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"73e1ed5e-9df2-4547-b9c7-4a9a32f7bd44\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0.5,1,1.5],\"y\":[1,2,3]}},\"id\":\"4ed9dcd6-a5b6-47d1-a1c9-de463c3f6d5d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"12d77393-4673-49ce-9a1d-5b6eecde42b3\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1d6dfd7a-e0c9-492d-8b55-13e7b231e3cd\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"06f3302f-b349-4794-9ee0-8588217a5b60\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"6e7caadd-bd28-44cc-8930-08cad82d6d02\",\"type\":\"CDSView\"}},\"id\":\"69e3497e-b6c2-406e-a277-6a8b25f02ac0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"06f3302f-b349-4794-9ee0-8588217a5b60\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"eff65350-ad6d-4b2b-8881-661324d6d41a\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"4cf0104f-bca1-4851-8aa0-5bead1f39a57\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"99b66f42-7743-4819-8beb-88cc734df7e8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"eff65350-ad6d-4b2b-8881-661324d6d41a\",\"type\":\"BasicTicker\"}},\"id\":\"540e6aa3-3089-48a6-a3d4-937db25aad2d\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5f7c8644-3a82-448e-a096-e8314d54b0dc\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"d9d360c9-979d-49fb-a323-472cfe713704\",\"type\":\"ResetTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"ec154e5f-fc60-4e8c-99d7-59e52ba10055\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"4ed9dcd6-a5b6-47d1-a1c9-de463c3f6d5d\",\"type\":\"ColumnDataSource\"}},\"id\":\"15480173-93f7-4b39-a362-d4d72baa83d2\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"4ed9dcd6-a5b6-47d1-a1c9-de463c3f6d5d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e2fcd265-e82b-4934-8165-fe27b8eaba90\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"d5a067f0-7e33-477b-a8d6-f39716dc0a8d\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"15480173-93f7-4b39-a362-d4d72baa83d2\",\"type\":\"CDSView\"}},\"id\":\"8f916fd1-5ae5-47ba-99ea-9851c1743880\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"brown\"},\"line_width\":{\"value\":4},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e2fcd265-e82b-4934-8165-fe27b8eaba90\",\"type\":\"Line\"}],\"root_ids\":[\"99b66f42-7743-4819-8beb-88cc734df7e8\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"37563164-e29a-4c05-9f5d-d47a1bbb30e3\",\"elementid\":\"f6fc88f3-097e-4aad-a181-d12874e67ce0\",\"modelid\":\"99b66f42-7743-4819-8beb-88cc734df7e8\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "99b66f42-7743-4819-8beb-88cc734df7e8" } }, "output_type": "display_data" } ], "source": [ "# 線の色の設定\n", "p = figure(plot_width=200, plot_height=200)\n", "p.line([0, 1, 2], [1, 2, 3], line_color='red')\n", "p.line([0.5, 1, 1.5], [1, 2, 3], line_width=4, line_color='brown')\n", "show(p)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"c572900c-34b4-4861-9e95-115ae91f8e5d\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"247518b9-d88a-4f42-b0fb-9a808d039bb8\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"ca0f3740-51d5-40e2-a760-4882b45b6a07\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[3,3]}},\"id\":\"8b7533dc-574c-4272-b979-73fc3dc0976c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ca0f3740-51d5-40e2-a760-4882b45b6a07\",\"type\":\"BasicTicker\"}},\"id\":\"20968ebc-f83c-46f2-8207-7ec6d9f9d222\",\"type\":\"Grid\"},{\"attributes\":{\"below\":[{\"id\":\"5da921b4-8350-45dc-a2e2-2df4c8a708a2\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"68f04409-3ab5-4406-9726-ebdd85169277\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"5da921b4-8350-45dc-a2e2-2df4c8a708a2\",\"type\":\"LinearAxis\"},{\"id\":\"35a6f813-f9c2-4bb7-9c78-dc17ca22f365\",\"type\":\"Grid\"},{\"id\":\"68f04409-3ab5-4406-9726-ebdd85169277\",\"type\":\"LinearAxis\"},{\"id\":\"20968ebc-f83c-46f2-8207-7ec6d9f9d222\",\"type\":\"Grid\"},{\"id\":\"a4fee586-9def-446b-a6d9-a8a7df85d763\",\"type\":\"BoxAnnotation\"},{\"id\":\"a2c11017-ceed-4a16-922c-dc14d8a165a6\",\"type\":\"GlyphRenderer\"},{\"id\":\"43cf1e4b-79af-4614-92d8-1d7dca589bbe\",\"type\":\"GlyphRenderer\"},{\"id\":\"5021e4a7-ceb8-4cc1-9d39-5f1f41502822\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"ee63bcb9-cb7b-4f48-a58a-8cac977884b8\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"6b6f4165-585f-423e-b2b5-85d219a9d972\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"19e9639f-ccd1-47ad-83ee-618a8707e03b\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"7fac5244-0fde-4a5f-a587-c5714c09e90c\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"0a2b347d-9a72-405c-86be-0cd76737d005\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"bcfc6315-8b04-4e53-bee4-e4c8b72be3f3\",\"type\":\"LinearScale\"}},\"id\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"8b7533dc-574c-4272-b979-73fc3dc0976c\",\"type\":\"ColumnDataSource\"}},\"id\":\"6a0aa07a-31ba-4b76-8775-70e2c165b13a\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"bef520ca-c575-4efa-a8e2-9992f7e9037d\",\"type\":\"PanTool\"},{\"id\":\"804e60c6-bb59-4921-9476-3694c324886e\",\"type\":\"WheelZoomTool\"},{\"id\":\"df2248c8-6867-40cf-aac4-877cce80b24d\",\"type\":\"BoxZoomTool\"},{\"id\":\"637a62cd-5dcc-41f0-8a36-e6bc9b804bef\",\"type\":\"SaveTool\"},{\"id\":\"151cb5de-77d6-4ae5-b1b1-4043089d662c\",\"type\":\"ResetTool\"},{\"id\":\"2654e7d4-08e8-479f-a2ed-9ca59b656d72\",\"type\":\"HelpTool\"}]},\"id\":\"6b6f4165-585f-423e-b2b5-85d219a9d972\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null},\"id\":\"19e9639f-ccd1-47ad-83ee-618a8707e03b\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"81cfc112-19b6-4924-9d70-509907272d6e\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"7fac5244-0fde-4a5f-a587-c5714c09e90c\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":{\"id\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c1222294-563a-4be5-af83-71e7f0cec6c4\",\"type\":\"BasicTicker\"}},\"id\":\"35a6f813-f9c2-4bb7-9c78-dc17ca22f365\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"bcfc6315-8b04-4e53-bee4-e4c8b72be3f3\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_color\":{\"value\":\"green\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"30a902be-bc75-4269-a6da-369287dd1d20\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"f47e344f-9b59-405e-a7af-e631659d159a\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c1222294-563a-4be5-af83-71e7f0cec6c4\",\"type\":\"BasicTicker\"}},\"id\":\"5da921b4-8350-45dc-a2e2-2df4c8a708a2\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"8b7533dc-574c-4272-b979-73fc3dc0976c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"30a902be-bc75-4269-a6da-369287dd1d20\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"81cfc112-19b6-4924-9d70-509907272d6e\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"6a0aa07a-31ba-4b76-8775-70e2c165b13a\",\"type\":\"CDSView\"}},\"id\":\"a2c11017-ceed-4a16-922c-dc14d8a165a6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[2,2]}},\"id\":\"c3f2a8d9-33b0-43e4-9991-7dcff2b883ce\",\"type\":\"ColumnDataSource\"},{\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"a4fee586-9def-446b-a6d9-a8a7df85d763\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"bef520ca-c575-4efa-a8e2-9992f7e9037d\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"f47e344f-9b59-405e-a7af-e631659d159a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"804e60c6-bb59-4921-9476-3694c324886e\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"a4fee586-9def-446b-a6d9-a8a7df85d763\",\"type\":\"BoxAnnotation\"}},\"id\":\"df2248c8-6867-40cf-aac4-877cce80b24d\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"637a62cd-5dcc-41f0-8a36-e6bc9b804bef\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"151cb5de-77d6-4ae5-b1b1-4043089d662c\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2654e7d4-08e8-479f-a2ed-9ca59b656d72\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[1,1]}},\"id\":\"81e8e5cb-0ad6-477f-8afd-839cdb7f62de\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"ee63bcb9-cb7b-4f48-a58a-8cac977884b8\",\"type\":\"Title\"},{\"attributes\":{\"line_alpha\":{\"value\":0.6},\"line_color\":{\"value\":\"green\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"23d0a9f0-9b20-4a93-83ec-896ec603b20a\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"c1222294-563a-4be5-af83-71e7f0cec6c4\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"c3f2a8d9-33b0-43e4-9991-7dcff2b883ce\",\"type\":\"ColumnDataSource\"}},\"id\":\"89f60cd8-9860-449a-8486-9662b6fc02e6\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"261e2d10-2a1a-4f25-af2c-f2a29d5d82ed\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"c3f2a8d9-33b0-43e4-9991-7dcff2b883ce\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"23d0a9f0-9b20-4a93-83ec-896ec603b20a\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"261e2d10-2a1a-4f25-af2c-f2a29d5d82ed\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"89f60cd8-9860-449a-8486-9662b6fc02e6\",\"type\":\"CDSView\"}},\"id\":\"43cf1e4b-79af-4614-92d8-1d7dca589bbe\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"rgba(0, 255, 0, 0.4)\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ba40f0b7-0d48-4210-b6e2-26d86057b718\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":30},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"76f8251e-a1ae-41a1-adf1-d6d33979831f\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"247518b9-d88a-4f42-b0fb-9a808d039bb8\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ca0f3740-51d5-40e2-a760-4882b45b6a07\",\"type\":\"BasicTicker\"}},\"id\":\"68f04409-3ab5-4406-9726-ebdd85169277\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"81e8e5cb-0ad6-477f-8afd-839cdb7f62de\",\"type\":\"ColumnDataSource\"}},\"id\":\"b0bfbeee-9f9f-4976-b010-c153d89118e2\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"81e8e5cb-0ad6-477f-8afd-839cdb7f62de\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ba40f0b7-0d48-4210-b6e2-26d86057b718\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"76f8251e-a1ae-41a1-adf1-d6d33979831f\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"b0bfbeee-9f9f-4976-b010-c153d89118e2\",\"type\":\"CDSView\"}},\"id\":\"5021e4a7-ceb8-4cc1-9d39-5f1f41502822\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"end\":3.5,\"start\":0.5},\"id\":\"0a2b347d-9a72-405c-86be-0cd76737d005\",\"type\":\"Range1d\"}],\"root_ids\":[\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"c572900c-34b4-4861-9e95-115ae91f8e5d\",\"elementid\":\"9cdfa619-8c21-4ebe-aebd-84f69cc9e4d3\",\"modelid\":\"f7683b48-85a8-4050-b4d7-a66f54c4b2aa\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "f7683b48-85a8-4050-b4d7-a66f54c4b2aa" } }, "output_type": "display_data" } ], "source": [ "# 線の不透明度の設定\n", "p = figure(plot_width=200, plot_height=200, y_range=(0.5, 3.5))\n", "p.line([0, 1], [3, 3], line_color='green', line_width=30)\n", "p.line([0, 1], [2, 2], line_alpha=0.6, line_color='green', line_width=30)\n", "p.line([0, 1], [1, 1], line_color=(0, 255, 0, 0.4), line_width=30 )\n", "show(p)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"2181a22b-478b-4fd1-9308-c36e8d0f56e2\":{\"roots\":{\"references\":[{\"attributes\":{\"data_source\":{\"id\":\"468bb4c3-c825-4d83-a130-4e7f56a29f7e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8d35db4f-1ff5-4df7-a533-599cc2d6dc65\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"cb83b8b2-b4a7-4c7c-895d-e6273fdbf98c\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"fac6e34c-3979-41e2-a513-beb863200666\",\"type\":\"CDSView\"}},\"id\":\"c94c22c2-aa6a-422e-b56e-de3e7d8888b7\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_join\":\"bevel\",\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8d35db4f-1ff5-4df7-a533-599cc2d6dc65\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"f4ffcf60-e32e-44f8-9944-97b96ca712c4\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_join\":\"bevel\",\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"cb83b8b2-b4a7-4c7c-895d-e6273fdbf98c\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"end\":2},\"id\":\"8a2cdc8f-c61b-4b18-b17f-9e592cefd6e4\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"e4169184-9230-4ac5-97a6-566e67d63b5b\",\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"0d13fb6e-de7a-47fa-9293-d18830289199\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"78084a52-407d-4ff4-aad1-6261b079378c\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"468bb4c3-c825-4d83-a130-4e7f56a29f7e\",\"type\":\"ColumnDataSource\"}},\"id\":\"fac6e34c-3979-41e2-a513-beb863200666\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"8476cf06-1170-49a4-9c53-ec602d2c23a1\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9398f5da-4c81-4d2c-aca3-f4c8289dff4c\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"0d13fb6e-de7a-47fa-9293-d18830289199\",\"type\":\"BoxAnnotation\"}},\"id\":\"bfed8142-783f-40c5-804a-19061ebde2b7\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2af4f471-24c9-4c7b-bf6f-8d997217a4fb\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"22a88698-b27c-44a8-8935-a77a9c91ab21\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2b7f913e-4e98-40c4-a171-99b3f76bb358\",\"type\":\"HelpTool\"},{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":0.5}},\"id\":\"4f1527d2-fba9-4cff-9504-d7a2dade4bf4\",\"type\":\"Text\"},{\"attributes\":{},\"id\":\"c02f2d6f-6de5-4bfb-b4ea-bb26d16a0733\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"0a0324c8-27fe-4cdf-abb2-1f9cae64135d\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"bevel\"]}},\"id\":\"8edd95cc-3c29-48c4-b433-47487bd6de03\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":1.5}},\"id\":\"e486cdfa-268c-4fbd-8fcb-c37d91fb474a\",\"type\":\"Text\"},{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":2.5}},\"id\":\"fc77e8a3-50f6-47ba-b23c-c403e012bd0e\",\"type\":\"Text\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1,0],\"y\":[1,1.5,2]}},\"id\":\"aad18a9d-e94a-4fc0-b41d-328410fb871e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"8edd95cc-3c29-48c4-b433-47487bd6de03\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4f1527d2-fba9-4cff-9504-d7a2dade4bf4\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2fac3d8e-4659-4cb1-bb69-834235caefa1\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"fb289ba6-c9d2-4b89-a55c-7bc05116a213\",\"type\":\"CDSView\"}},\"id\":\"6b4a8461-ed16-4dec-b615-16723188ca81\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":0.5}},\"id\":\"2fac3d8e-4659-4cb1-bb69-834235caefa1\",\"type\":\"Text\"},{\"attributes\":{\"source\":{\"id\":\"8edd95cc-3c29-48c4-b433-47487bd6de03\",\"type\":\"ColumnDataSource\"}},\"id\":\"fb289ba6-c9d2-4b89-a55c-7bc05116a213\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_join\":\"round\",\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c27eae2d-787a-441a-8a88-c5eaf933a60d\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"aad18a9d-e94a-4fc0-b41d-328410fb871e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c27eae2d-787a-441a-8a88-c5eaf933a60d\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"ff4c11ae-2b1e-4f7b-a786-4855a898ddf5\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"bf2bddd8-e636-484e-a554-7697d31a9cf1\",\"type\":\"CDSView\"}},\"id\":\"42a25ca0-1937-4c32-8cb9-644445d59a10\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_join\":\"round\",\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ff4c11ae-2b1e-4f7b-a786-4855a898ddf5\",\"type\":\"Line\"},{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":1.5}},\"id\":\"dcd8769b-5f8a-40fc-b337-13299c8bf33a\",\"type\":\"Text\"},{\"attributes\":{},\"id\":\"befa2d3d-64de-463b-9c71-c06727a339ad\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"aad18a9d-e94a-4fc0-b41d-328410fb871e\",\"type\":\"ColumnDataSource\"}},\"id\":\"bf2bddd8-e636-484e-a554-7697d31a9cf1\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c1993eb5-6a4a-4476-98d5-7332b671ea5a\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"55f2eb6d-086f-4ffd-99bb-55f89b9e349e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"dcd8769b-5f8a-40fc-b337-13299c8bf33a\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"e486cdfa-268c-4fbd-8fcb-c37d91fb474a\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"d00a844c-5aca-4ef6-8d74-c8f1c4e59b4f\",\"type\":\"CDSView\"}},\"id\":\"e2242adb-3a70-480e-a776-cd624a7a794e\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1,0],\"y\":[2,2.5,3]}},\"id\":\"da4553d8-c4f2-4772-ae5a-5850d492c219\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"55f2eb6d-086f-4ffd-99bb-55f89b9e349e\",\"type\":\"ColumnDataSource\"}},\"id\":\"d00a844c-5aca-4ef6-8d74-c8f1c4e59b4f\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"03ece265-8e4f-4917-9700-845450309c68\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1,0],\"y\":[0,0.5,1]}},\"id\":\"468bb4c3-c825-4d83-a130-4e7f56a29f7e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":1.5},\"y\":{\"value\":2.5}},\"id\":\"a019f57f-de7f-4de0-8dd3-408d5f0a257d\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"da4553d8-c4f2-4772-ae5a-5850d492c219\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"03ece265-8e4f-4917-9700-845450309c68\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"c1993eb5-6a4a-4476-98d5-7332b671ea5a\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"7ff1fe4b-bc18-4370-9072-6f0e9c6d009d\",\"type\":\"CDSView\"}},\"id\":\"4cb7b35b-85e5-4060-9c9f-c0cb6c77f2d7\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"78084a52-407d-4ff4-aad1-6261b079378c\",\"type\":\"PanTool\"},{\"id\":\"9398f5da-4c81-4d2c-aca3-f4c8289dff4c\",\"type\":\"WheelZoomTool\"},{\"id\":\"bfed8142-783f-40c5-804a-19061ebde2b7\",\"type\":\"BoxZoomTool\"},{\"id\":\"2af4f471-24c9-4c7b-bf6f-8d997217a4fb\",\"type\":\"SaveTool\"},{\"id\":\"22a88698-b27c-44a8-8935-a77a9c91ab21\",\"type\":\"ResetTool\"},{\"id\":\"2b7f913e-4e98-40c4-a171-99b3f76bb358\",\"type\":\"HelpTool\"}]},\"id\":\"32671c92-d97f-45dd-9db3-b1301495503f\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"miter\"]}},\"id\":\"6b1e9cd8-e5aa-4b59-a198-7bc5239f577e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"da4553d8-c4f2-4772-ae5a-5850d492c219\",\"type\":\"ColumnDataSource\"}},\"id\":\"7ff1fe4b-bc18-4370-9072-6f0e9c6d009d\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"8e37ae90-7470-45c9-8953-d9f1415c41ec\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"6b1e9cd8-e5aa-4b59-a198-7bc5239f577e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fc77e8a3-50f6-47ba-b23c-c403e012bd0e\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"a019f57f-de7f-4de0-8dd3-408d5f0a257d\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"1289fd11-ecff-4fb4-9275-05785b518665\",\"type\":\"CDSView\"}},\"id\":\"f55914c4-336b-4d49-82fc-1c7b68db0cb3\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"6b1e9cd8-e5aa-4b59-a198-7bc5239f577e\",\"type\":\"ColumnDataSource\"}},\"id\":\"1289fd11-ecff-4fb4-9275-05785b518665\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"c02f2d6f-6de5-4bfb-b4ea-bb26d16a0733\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"befa2d3d-64de-463b-9c71-c06727a339ad\",\"type\":\"BasicTicker\"}},\"id\":\"6c38b96f-94e1-43d5-918e-4c2a740f1aa9\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b4b29ec6-4abc-43f6-bf6e-90c4bd259eef\",\"type\":\"BasicTicker\"}},\"id\":\"d55cf0a4-d95f-4973-953c-a6fee87fc157\",\"type\":\"Grid\"},{\"attributes\":{\"below\":[{\"id\":\"6c38b96f-94e1-43d5-918e-4c2a740f1aa9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"f8fae8d2-328d-4769-ac7e-d0450b1882e0\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"6c38b96f-94e1-43d5-918e-4c2a740f1aa9\",\"type\":\"LinearAxis\"},{\"id\":\"d9c9cce2-16f1-44b0-88cd-4861bb95c234\",\"type\":\"Grid\"},{\"id\":\"f8fae8d2-328d-4769-ac7e-d0450b1882e0\",\"type\":\"LinearAxis\"},{\"id\":\"d55cf0a4-d95f-4973-953c-a6fee87fc157\",\"type\":\"Grid\"},{\"id\":\"0d13fb6e-de7a-47fa-9293-d18830289199\",\"type\":\"BoxAnnotation\"},{\"id\":\"c94c22c2-aa6a-422e-b56e-de3e7d8888b7\",\"type\":\"GlyphRenderer\"},{\"id\":\"6b4a8461-ed16-4dec-b615-16723188ca81\",\"type\":\"GlyphRenderer\"},{\"id\":\"42a25ca0-1937-4c32-8cb9-644445d59a10\",\"type\":\"GlyphRenderer\"},{\"id\":\"e2242adb-3a70-480e-a776-cd624a7a794e\",\"type\":\"GlyphRenderer\"},{\"id\":\"4cb7b35b-85e5-4060-9c9f-c0cb6c77f2d7\",\"type\":\"GlyphRenderer\"},{\"id\":\"f55914c4-336b-4d49-82fc-1c7b68db0cb3\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"0a0324c8-27fe-4cdf-abb2-1f9cae64135d\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"32671c92-d97f-45dd-9db3-b1301495503f\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"8a2cdc8f-c61b-4b18-b17f-9e592cefd6e4\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"8476cf06-1170-49a4-9c53-ec602d2c23a1\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"8e37ae90-7470-45c9-8953-d9f1415c41ec\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"f4ffcf60-e32e-44f8-9944-97b96ca712c4\",\"type\":\"LinearScale\"}},\"id\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"b4b29ec6-4abc-43f6-bf6e-90c4bd259eef\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"befa2d3d-64de-463b-9c71-c06727a339ad\",\"type\":\"BasicTicker\"}},\"id\":\"d9c9cce2-16f1-44b0-88cd-4861bb95c234\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"e4169184-9230-4ac5-97a6-566e67d63b5b\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b4b29ec6-4abc-43f6-bf6e-90c4bd259eef\",\"type\":\"BasicTicker\"}},\"id\":\"f8fae8d2-328d-4769-ac7e-d0450b1882e0\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"round\"]}},\"id\":\"55f2eb6d-086f-4ffd-99bb-55f89b9e349e\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"2181a22b-478b-4fd1-9308-c36e8d0f56e2\",\"elementid\":\"5e3034bf-66d3-45de-835a-bb5dc9c74826\",\"modelid\":\"1db8ddd4-fe6a-4e0d-96cb-113176b21d1c\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "1db8ddd4-fe6a-4e0d-96cb-113176b21d1c" } }, "output_type": "display_data" } ], "source": [ "# 線の結合店を設定\n", "p = figure(plot_width=200, plot_height=200, x_range=(0, 2))\n", "\n", "for y, line in enumerate(['bevel', 'round', 'miter']):\n", " p.line([0, 1, 0], [y, y + 0.5, y + 1], line_width=10, line_join=line)\n", " p.text(1.5, y + 0.5, text=[line], text_align='center')\n", " \n", "show(p)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"501c146a-f646-4329-985c-5147bc3fbfaa\":{\"roots\":{\"references\":[{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":1}},\"id\":\"a91582dc-bf56-46d0-a253-c8f2f89a3685\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"e8f85d3d-5a0e-41d4-993a-4956ef1b4a58\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4702699a-a5d4-48ac-b47e-18f44e064fec\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6e0cf160-6aad-49a0-b93b-2cdba443da54\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"bd73f594-f546-470c-8815-f8decba14b7c\",\"type\":\"CDSView\"}},\"id\":\"9e1c0614-44a2-4c19-be9a-d28e58aa7f7f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"091f54b8-8db2-41aa-8759-21f2c7cf6d0a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"e8f85d3d-5a0e-41d4-993a-4956ef1b4a58\",\"type\":\"ColumnDataSource\"}},\"id\":\"bd73f594-f546-470c-8815-f8decba14b7c\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":{\"id\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"66cfee23-b357-4d9b-8d94-f72eea19c5ae\",\"type\":\"BasicTicker\"}},\"id\":\"4e5e1599-d138-4de8-9150-8c664cc25a3b\",\"type\":\"Grid\"},{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":2}},\"id\":\"deb3714c-a028-4d15-ba4b-42d0aeebf8e2\",\"type\":\"Text\"},{\"attributes\":{},\"id\":\"66cfee23-b357-4d9b-8d94-f72eea19c5ae\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"round\"]}},\"id\":\"952cc3a1-770b-4677-9c3c-d389a33dbc96\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1b9b7d7b-0940-4047-8add-a2f23cb8b93a\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5e74a411-a86e-4b29-bad5-3aa622cabf32\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"end\":2.5,\"start\":-0.5},\"id\":\"03f7da1d-97de-4ff5-a44b-d6c140021a09\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[2,2]}},\"id\":\"65739cf9-8595-49bf-89a5-7b957951d7ca\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"formatter\":{\"id\":\"9183b496-f0a5-48c3-9fe9-6aca89567b91\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2de453b6-d649-4f7a-b1b4-fd72457507f1\",\"type\":\"BasicTicker\"}},\"id\":\"fad6fd94-8b46-45d9-9ef6-0d4d937c8d06\",\"type\":\"LinearAxis\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":1}},\"id\":\"c4efef8a-afb8-4b40-af5e-2bd302ea2217\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"952cc3a1-770b-4677-9c3c-d389a33dbc96\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a91582dc-bf56-46d0-a253-c8f2f89a3685\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"c4efef8a-afb8-4b40-af5e-2bd302ea2217\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"af6cbae1-8607-4db2-a515-093d7c8340db\",\"type\":\"CDSView\"}},\"id\":\"3f7bcba6-383c-4fe3-9ac3-14c3bde03310\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"a91e3d79-ee23-43a1-98f0-40ad79403079\",\"type\":\"BoxAnnotation\"}},\"id\":\"d2570c7a-6b6a-4570-93a1-ce6163ab9c8e\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"952cc3a1-770b-4677-9c3c-d389a33dbc96\",\"type\":\"ColumnDataSource\"}},\"id\":\"af6cbae1-8607-4db2-a515-093d7c8340db\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2de453b6-d649-4f7a-b1b4-fd72457507f1\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"79eb64dd-19c4-42a8-a53c-a36381b7961e\",\"type\":\"Line\"},{\"attributes\":{\"line_cap\":\"square\",\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7c8ae668-f76b-491c-9121-343b5fc64de7\",\"type\":\"Line\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":2}},\"id\":\"0e2a5698-853a-479c-812a-6b26bd2ddf17\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"65739cf9-8595-49bf-89a5-7b957951d7ca\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"79eb64dd-19c4-42a8-a53c-a36381b7961e\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5e74a411-a86e-4b29-bad5-3aa622cabf32\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"d26d8543-d31a-4c16-ba58-07b11eb5ddeb\",\"type\":\"CDSView\"}},\"id\":\"24dd51a6-db1f-4229-85c1-8f0766909db4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"f2becdb2-aa3b-40bb-9cbf-ad2f60936f40\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"fad6fd94-8b46-45d9-9ef6-0d4d937c8d06\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"f2becdb2-aa3b-40bb-9cbf-ad2f60936f40\",\"type\":\"LinearAxis\"},{\"id\":\"4e5e1599-d138-4de8-9150-8c664cc25a3b\",\"type\":\"Grid\"},{\"id\":\"fad6fd94-8b46-45d9-9ef6-0d4d937c8d06\",\"type\":\"LinearAxis\"},{\"id\":\"b800f8b6-b8c8-4077-8202-df4964865318\",\"type\":\"Grid\"},{\"id\":\"a91e3d79-ee23-43a1-98f0-40ad79403079\",\"type\":\"BoxAnnotation\"},{\"id\":\"43949165-2715-41fb-99e3-d2a4e8761a12\",\"type\":\"GlyphRenderer\"},{\"id\":\"454f3dcf-6d03-4c09-b291-66fe60b66afd\",\"type\":\"GlyphRenderer\"},{\"id\":\"9e1c0614-44a2-4c19-be9a-d28e58aa7f7f\",\"type\":\"GlyphRenderer\"},{\"id\":\"3f7bcba6-383c-4fe3-9ac3-14c3bde03310\",\"type\":\"GlyphRenderer\"},{\"id\":\"24dd51a6-db1f-4229-85c1-8f0766909db4\",\"type\":\"GlyphRenderer\"},{\"id\":\"ea6676e1-e8c3-4919-90ee-cc560b95f84c\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"51852433-19db-4ad6-af57-a935594ebc04\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2fda190f-3908-4923-93bc-74cc3de21ed7\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"03f7da1d-97de-4ff5-a44b-d6c140021a09\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"1b9b7d7b-0940-4047-8add-a2f23cb8b93a\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"020b3034-3c26-4258-b473-38b30850cdd1\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"9265106d-4ecf-4777-8e2f-abf9198308b5\",\"type\":\"LinearScale\"}},\"id\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"butt\"]}},\"id\":\"8060e7c3-8546-44bb-8a1a-c477a219a372\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_cap\":\"square\",\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4b4df708-2e81-40be-9221-edff2dcb6a29\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"65739cf9-8595-49bf-89a5-7b957951d7ca\",\"type\":\"ColumnDataSource\"}},\"id\":\"d26d8543-d31a-4c16-ba58-07b11eb5ddeb\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"0d474fdb-c308-42aa-9f54-bd4fdbc23b82\",\"type\":\"PanTool\"},{\"id\":\"091f54b8-8db2-41aa-8759-21f2c7cf6d0a\",\"type\":\"WheelZoomTool\"},{\"id\":\"d2570c7a-6b6a-4570-93a1-ce6163ab9c8e\",\"type\":\"BoxZoomTool\"},{\"id\":\"0ec7ad20-848c-4d6e-98dc-489a26811483\",\"type\":\"SaveTool\"},{\"id\":\"91567a46-b2ef-4fd4-a8b1-2d2720f57b56\",\"type\":\"ResetTool\"},{\"id\":\"1de10b75-f276-4e88-97c6-fbc9c8523633\",\"type\":\"HelpTool\"}]},\"id\":\"2fda190f-3908-4923-93bc-74cc3de21ed7\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"9183b496-f0a5-48c3-9fe9-6aca89567b91\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"8060e7c3-8546-44bb-8a1a-c477a219a372\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"deb3714c-a028-4d15-ba4b-42d0aeebf8e2\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"0e2a5698-853a-479c-812a-6b26bd2ddf17\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"8ef16c85-88cb-4c14-af4e-6049f8200f8b\",\"type\":\"CDSView\"}},\"id\":\"ea6676e1-e8c3-4919-90ee-cc560b95f84c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[0,0]}},\"id\":\"8bc3e57e-57ec-4024-9977-eb1c4d44907f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"8060e7c3-8546-44bb-8a1a-c477a219a372\",\"type\":\"ColumnDataSource\"}},\"id\":\"8ef16c85-88cb-4c14-af4e-6049f8200f8b\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"8bc3e57e-57ec-4024-9977-eb1c4d44907f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7c8ae668-f76b-491c-9121-343b5fc64de7\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4b4df708-2e81-40be-9221-edff2dcb6a29\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1542282f-2a4a-4465-861e-4f871d9a7be9\",\"type\":\"CDSView\"}},\"id\":\"43949165-2715-41fb-99e3-d2a4e8761a12\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text_align\":\"center\",\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":0}},\"id\":\"128db7d5-32f0-4efe-8f70-4c09f1f6a113\",\"type\":\"Text\"},{\"attributes\":{},\"id\":\"99dddfcd-5398-4e64-8b01-a1ec2d1ee5de\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[1,1]}},\"id\":\"e8f85d3d-5a0e-41d4-993a-4956ef1b4a58\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"eb3c7658-fd05-42aa-a37c-d1e7efba0067\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"128db7d5-32f0-4efe-8f70-4c09f1f6a113\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"23c19660-d11e-46f6-bdec-005d0124e5ee\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"55120e0e-8a0a-4ad4-aa7c-d28f0667b6ea\",\"type\":\"CDSView\"}},\"id\":\"454f3dcf-6d03-4c09-b291-66fe60b66afd\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"0d474fdb-c308-42aa-9f54-bd4fdbc23b82\",\"type\":\"PanTool\"},{\"attributes\":{\"text_align\":\"center\",\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":2},\"y\":{\"value\":0}},\"id\":\"23c19660-d11e-46f6-bdec-005d0124e5ee\",\"type\":\"Text\"},{\"attributes\":{\"callback\":null,\"end\":2.5,\"start\":-0.5},\"id\":\"020b3034-3c26-4258-b473-38b30850cdd1\",\"type\":\"Range1d\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2de453b6-d649-4f7a-b1b4-fd72457507f1\",\"type\":\"BasicTicker\"}},\"id\":\"b800f8b6-b8c8-4077-8202-df4964865318\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1de10b75-f276-4e88-97c6-fbc9c8523633\",\"type\":\"HelpTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_cap\":\"round\",\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6e0cf160-6aad-49a0-b93b-2cdba443da54\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"8bc3e57e-57ec-4024-9977-eb1c4d44907f\",\"type\":\"ColumnDataSource\"}},\"id\":\"1542282f-2a4a-4465-861e-4f871d9a7be9\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"51852433-19db-4ad6-af57-a935594ebc04\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"square\"]}},\"id\":\"eb3c7658-fd05-42aa-a37c-d1e7efba0067\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"0ec7ad20-848c-4d6e-98dc-489a26811483\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"91567a46-b2ef-4fd4-a8b1-2d2720f57b56\",\"type\":\"ResetTool\"},{\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"a91e3d79-ee23-43a1-98f0-40ad79403079\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"9265106d-4ecf-4777-8e2f-abf9198308b5\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"eb3c7658-fd05-42aa-a37c-d1e7efba0067\",\"type\":\"ColumnDataSource\"}},\"id\":\"55120e0e-8a0a-4ad4-aa7c-d28f0667b6ea\",\"type\":\"CDSView\"},{\"attributes\":{\"line_cap\":\"round\",\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4702699a-a5d4-48ac-b47e-18f44e064fec\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"99dddfcd-5398-4e64-8b01-a1ec2d1ee5de\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"66cfee23-b357-4d9b-8d94-f72eea19c5ae\",\"type\":\"BasicTicker\"}},\"id\":\"f2becdb2-aa3b-40bb-9cbf-ad2f60936f40\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"501c146a-f646-4329-985c-5147bc3fbfaa\",\"elementid\":\"662c7722-6de6-41c3-bce7-a910179da724\",\"modelid\":\"1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "1c1c4d97-7558-492e-b2d7-5e1a82a4ad6e" } }, "output_type": "display_data" } ], "source": [ "# 線の先端の設定\n", "p = figure(plot_width=200, plot_height=200,\n", " x_range=[-0.5, 2.5], y_range=[-0.5, 2.5])\n", "\n", "for y, line in enumerate(['square', 'round', 'butt']):\n", " p.line([0, 1], [y, y ], line_width=20, line_cap=line)\n", " p.text(2, y, text=[line], text_align='center')\n", " \n", "show(p)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"d5d6a260-203d-467c-a872-186d3a3be655\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"dashed\"]}},\"id\":\"f3d18b26-4416-486e-8df6-bd2f3b483362\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"e0c976cb-6497-4a2f-a205-431ce41c3046\",\"type\":\"ColumnDataSource\"}},\"id\":\"92ec2776-ffb1-4883-bb64-e6ebd24d103f\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"e0c976cb-6497-4a2f-a205-431ce41c3046\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"5bfd62b3-d0c9-49ca-ad30-9c9858c54569\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"f4a0edfd-21f3-4399-b2d1-8c55527734bc\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"92ec2776-ffb1-4883-bb64-e6ebd24d103f\",\"type\":\"CDSView\"}},\"id\":\"dcb50952-2fb3-4212-a743-627fd91279d7\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":2}},\"id\":\"f61848f4-f546-47ac-9d29-4b1aa98d96e9\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"98488644-8d4f-453b-a8f3-d8c0c92343c7\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"dc06b6a3-3470-4127-8e7d-f08ae44c100a\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"374f88d7-ef79-4465-b8ed-1d541ed758fc\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"8a961aae-6ff3-4477-8898-bf797adfba0f\",\"type\":\"CDSView\"}},\"id\":\"ab04ad8f-b991-4800-8690-4dc7353d7ac6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"98488644-8d4f-453b-a8f3-d8c0c92343c7\",\"type\":\"ColumnDataSource\"}},\"id\":\"8a961aae-6ff3-4477-8898-bf797adfba0f\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"6fc65052-bb82-40ce-be23-b89487d50133\",\"type\":\"ColumnDataSource\"}},\"id\":\"fa98b3fc-a110-47d6-8b3f-6ba4a2dfc238\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"dotted\"]}},\"id\":\"b07e9455-87a5-435b-917d-884bf0b31702\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":4}},\"id\":\"ba118245-c5a9-488c-b445-58bd4dadc22e\",\"type\":\"Text\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[2,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"dc06b6a3-3470-4127-8e7d-f08ae44c100a\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"1fe8e00e-c036-4377-aac2-309142db0598\",\"type\":\"ColumnDataSource\"}},\"id\":\"6cf0ae51-90d8-4366-a06c-4c4536cf18f2\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[2,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"374f88d7-ef79-4465-b8ed-1d541ed758fc\",\"type\":\"Line\"},{\"attributes\":{\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":4}},\"id\":\"1c9855aa-8f7d-458b-920f-479374bdf8ad\",\"type\":\"Text\"},{\"attributes\":{},\"id\":\"0b203650-94eb-485a-9f73-e47f25df65dd\",\"type\":\"LinearScale\"},{\"attributes\":{\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":3}},\"id\":\"5bfd62b3-d0c9-49ca-ad30-9c9858c54569\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"b07e9455-87a5-435b-917d-884bf0b31702\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"bfc006af-82f6-4293-9bdb-f6d159907bdf\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"f61848f4-f546-47ac-9d29-4b1aa98d96e9\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"1933f7ce-547b-4bf2-918d-7607b0346ac8\",\"type\":\"CDSView\"}},\"id\":\"01a0da6e-cf89-48a2-bd59-ee9933dad3b5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"1fe8e00e-c036-4377-aac2-309142db0598\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ba118245-c5a9-488c-b445-58bd4dadc22e\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1c9855aa-8f7d-458b-920f-479374bdf8ad\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"6cf0ae51-90d8-4366-a06c-4c4536cf18f2\",\"type\":\"CDSView\"}},\"id\":\"f02ba0c5-0602-4854-9732-f8d391f628d0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"905471cb-040b-44eb-9631-f26af9d5aeea\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[3,3]}},\"id\":\"631a3bc8-3641-4d32-9d4a-e530eb4bd47a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[2,2]}},\"id\":\"98488644-8d4f-453b-a8f3-d8c0c92343c7\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"631a3bc8-3641-4d32-9d4a-e530eb4bd47a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ea5b774c-0476-4673-bdfa-d74f14580bf1\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"70705c5c-041a-429d-90cd-3a6a72d75754\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"3935b4ac-1e07-4475-a538-e2e319c13769\",\"type\":\"CDSView\"}},\"id\":\"321e4222-b64a-4b9d-b7b8-2180bffe5615\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"e6cd154a-3a22-45a0-b26c-b78cbb8b5e78\",\"type\":\"DataRange1d\"},{\"attributes\":{\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":2}},\"id\":\"bfc006af-82f6-4293-9bdb-f6d159907bdf\",\"type\":\"Text\"},{\"attributes\":{\"source\":{\"id\":\"b07e9455-87a5-435b-917d-884bf0b31702\",\"type\":\"ColumnDataSource\"}},\"id\":\"1933f7ce-547b-4bf2-918d-7607b0346ac8\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[6,4,2,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"107c70d8-0240-41a6-9753-43e2dccce5cb\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[2,4,6,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"70705c5c-041a-429d-90cd-3a6a72d75754\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[2,4,6,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ea5b774c-0476-4673-bdfa-d74f14580bf1\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[6,4,2,4],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3c03c5a4-adf5-4870-8f4a-27e4620c7d4c\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"dotdash\"]}},\"id\":\"e0c976cb-6497-4a2f-a205-431ce41c3046\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"dashdot\"]}},\"id\":\"1fe8e00e-c036-4377-aac2-309142db0598\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"6fc65052-bb82-40ce-be23-b89487d50133\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3c03c5a4-adf5-4870-8f4a-27e4620c7d4c\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"107c70d8-0240-41a6-9753-43e2dccce5cb\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"fa98b3fc-a110-47d6-8b3f-6ba4a2dfc238\",\"type\":\"CDSView\"}},\"id\":\"294abd00-d692-4dfe-9983-d915d21bd425\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"631a3bc8-3641-4d32-9d4a-e530eb4bd47a\",\"type\":\"ColumnDataSource\"}},\"id\":\"3935b4ac-1e07-4475-a538-e2e319c13769\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[4,4]}},\"id\":\"6fc65052-bb82-40ce-be23-b89487d50133\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":3}},\"id\":\"f4a0edfd-21f3-4399-b2d1-8c55527734bc\",\"type\":\"Text\"},{\"attributes\":{\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":1}},\"id\":\"fedb827f-4624-4af5-9b3a-59bed7c84f66\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"f3d18b26-4416-486e-8df6-bd2f3b483362\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fedb827f-4624-4af5-9b3a-59bed7c84f66\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"216b378a-f2be-498b-a3c0-ba5f563a4d8b\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"8812b43a-d2b3-489e-8b59-1fe471b7fe54\",\"type\":\"CDSView\"}},\"id\":\"2192024c-14e9-4840-a25d-29eab76b0dd6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":1}},\"id\":\"216b378a-f2be-498b-a3c0-ba5f563a4d8b\",\"type\":\"Text\"},{\"attributes\":{\"callback\":null,\"end\":5,\"start\":-0.5},\"id\":\"375f20c4-fd89-4397-90c8-cbe719364dea\",\"type\":\"Range1d\"},{\"attributes\":{\"source\":{\"id\":\"f3d18b26-4416-486e-8df6-bd2f3b483362\",\"type\":\"ColumnDataSource\"}},\"id\":\"8812b43a-d2b3-489e-8b59-1fe471b7fe54\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"text\"],\"data\":{\"text\":[\"solid\"]}},\"id\":\"f1c7e632-4e2b-49ae-9701-6ec447313e4a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"0f835d7d-8c83-4e8d-b58b-04452e947812\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"3bcd3b37-2285-4ea1-9c9c-010970e06301\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"0f835d7d-8c83-4e8d-b58b-04452e947812\",\"type\":\"LinearAxis\"},{\"id\":\"b1412018-1427-40e3-a5a4-7602eea4e40c\",\"type\":\"Grid\"},{\"id\":\"3bcd3b37-2285-4ea1-9c9c-010970e06301\",\"type\":\"LinearAxis\"},{\"id\":\"4227eb7f-1540-435e-9c90-9709be030346\",\"type\":\"Grid\"},{\"id\":\"bb27e968-675f-41d4-aac4-467b4ee23fc7\",\"type\":\"BoxAnnotation\"},{\"id\":\"f83bcea9-7d00-46db-9afa-e6d65c3f3785\",\"type\":\"GlyphRenderer\"},{\"id\":\"f650e393-f388-49e0-9df2-75bad25d3d81\",\"type\":\"GlyphRenderer\"},{\"id\":\"decb2ce3-d22f-4aa5-9cf3-9056c8c1e9c7\",\"type\":\"GlyphRenderer\"},{\"id\":\"2192024c-14e9-4840-a25d-29eab76b0dd6\",\"type\":\"GlyphRenderer\"},{\"id\":\"ab04ad8f-b991-4800-8690-4dc7353d7ac6\",\"type\":\"GlyphRenderer\"},{\"id\":\"01a0da6e-cf89-48a2-bd59-ee9933dad3b5\",\"type\":\"GlyphRenderer\"},{\"id\":\"321e4222-b64a-4b9d-b7b8-2180bffe5615\",\"type\":\"GlyphRenderer\"},{\"id\":\"dcb50952-2fb3-4212-a743-627fd91279d7\",\"type\":\"GlyphRenderer\"},{\"id\":\"294abd00-d692-4dfe-9983-d915d21bd425\",\"type\":\"GlyphRenderer\"},{\"id\":\"f02ba0c5-0602-4854-9732-f8d391f628d0\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2ac2210c-e2b2-49ef-9e05-2ba583271960\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"dbca63fd-e7a0-4eca-942d-82d76d788af3\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"e6cd154a-3a22-45a0-b26c-b78cbb8b5e78\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"0b203650-94eb-485a-9f73-e47f25df65dd\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"375f20c4-fd89-4397-90c8-cbe719364dea\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"549ec675-979e-45fa-a262-fae7989ba044\",\"type\":\"LinearScale\"}},\"id\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c02303fe-0648-4d18-8306-3636b7764746\",\"type\":\"Line\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"22512b88-4bba-40c3-a549-abb85f6ab8b2\",\"type\":\"PanTool\"},{\"id\":\"026fc2a2-c025-49c5-bf25-af7e566e9734\",\"type\":\"WheelZoomTool\"},{\"id\":\"a98e6e78-b2cb-4136-aea4-8292d577081e\",\"type\":\"BoxZoomTool\"},{\"id\":\"3d145179-77b6-466b-9cfe-c93aa400178d\",\"type\":\"SaveTool\"},{\"id\":\"210078dd-6586-40a7-b438-71d0255b6110\",\"type\":\"ResetTool\"},{\"id\":\"7a35d2e0-9df3-44dd-9f8e-0fc452f3efae\",\"type\":\"HelpTool\"}]},\"id\":\"dbca63fd-e7a0-4eca-942d-82d76d788af3\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"549ec675-979e-45fa-a262-fae7989ba044\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"2ac2210c-e2b2-49ef-9e05-2ba583271960\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"6a6f84ae-19a6-415e-91b8-1409ef4cdf23\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"b0841613-26b8-488c-8d04-2736a01a3abd\",\"type\":\"ColumnDataSource\"}},\"id\":\"c714d632-dfcf-4eaa-aabf-b48774916e8b\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":{\"id\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"238c1d61-d553-45d9-8d75-9fd0fed963a6\",\"type\":\"BasicTicker\"}},\"id\":\"b1412018-1427-40e3-a5a4-7602eea4e40c\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"6a6f84ae-19a6-415e-91b8-1409ef4cdf23\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"238c1d61-d553-45d9-8d75-9fd0fed963a6\",\"type\":\"BasicTicker\"}},\"id\":\"0f835d7d-8c83-4e8d-b58b-04452e947812\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"238c1d61-d553-45d9-8d75-9fd0fed963a6\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"905471cb-040b-44eb-9631-f26af9d5aeea\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0455983f-c792-4698-9054-7362be7a38a0\",\"type\":\"BasicTicker\"}},\"id\":\"3bcd3b37-2285-4ea1-9c9c-010970e06301\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"0455983f-c792-4698-9054-7362be7a38a0\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0455983f-c792-4698-9054-7362be7a38a0\",\"type\":\"BasicTicker\"}},\"id\":\"4227eb7f-1540-435e-9c90-9709be030346\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"f1c7e632-4e2b-49ae-9701-6ec447313e4a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2f379965-1330-4660-911f-f8e54bab9cfb\",\"type\":\"Text\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"f2d6fd69-b64b-4817-ab29-beb4a75437e5\",\"type\":\"Text\"},\"selection_glyph\":null,\"view\":{\"id\":\"9154a718-6e88-4074-b205-5947aa7498af\",\"type\":\"CDSView\"}},\"id\":\"f650e393-f388-49e0-9df2-75bad25d3d81\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[0,0]}},\"id\":\"b82bbb59-da11-45a1-968c-f9f2d8a669ae\",\"type\":\"ColumnDataSource\"},{\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"bb27e968-675f-41d4-aac4-467b4ee23fc7\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"22512b88-4bba-40c3-a549-abb85f6ab8b2\",\"type\":\"PanTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"0288f69b-f05a-4b1b-8e42-3e744079fcd6\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"026fc2a2-c025-49c5-bf25-af7e566e9734\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"bb27e968-675f-41d4-aac4-467b4ee23fc7\",\"type\":\"BoxAnnotation\"}},\"id\":\"a98e6e78-b2cb-4136-aea4-8292d577081e\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"3d145179-77b6-466b-9cfe-c93aa400178d\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"210078dd-6586-40a7-b438-71d0255b6110\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"7a35d2e0-9df3-44dd-9f8e-0fc452f3efae\",\"type\":\"HelpTool\"},{\"attributes\":{\"text_alpha\":{\"value\":0.1},\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":0}},\"id\":\"f2d6fd69-b64b-4817-ab29-beb4a75437e5\",\"type\":\"Text\"},{\"attributes\":{\"data_source\":{\"id\":\"b82bbb59-da11-45a1-968c-f9f2d8a669ae\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c02303fe-0648-4d18-8306-3636b7764746\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"0288f69b-f05a-4b1b-8e42-3e744079fcd6\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"a878fe61-8c05-40f8-8b3c-165240946e00\",\"type\":\"CDSView\"}},\"id\":\"f83bcea9-7d00-46db-9afa-e6d65c3f3785\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"b82bbb59-da11-45a1-968c-f9f2d8a669ae\",\"type\":\"ColumnDataSource\"}},\"id\":\"a878fe61-8c05-40f8-8b3c-165240946e00\",\"type\":\"CDSView\"},{\"attributes\":{\"text_color\":{\"value\":\"black\"},\"x\":{\"value\":0},\"y\":{\"value\":0}},\"id\":\"2f379965-1330-4660-911f-f8e54bab9cfb\",\"type\":\"Text\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[6],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"04d27474-83c2-4be5-b5a4-18c558f8f990\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"f1c7e632-4e2b-49ae-9701-6ec447313e4a\",\"type\":\"ColumnDataSource\"}},\"id\":\"9154a718-6e88-4074-b205-5947aa7498af\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[6],\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"df13755a-b93b-4c6b-86e9-d135787dc65e\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[1,1]}},\"id\":\"b0841613-26b8-488c-8d04-2736a01a3abd\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"b0841613-26b8-488c-8d04-2736a01a3abd\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"df13755a-b93b-4c6b-86e9-d135787dc65e\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"04d27474-83c2-4be5-b5a4-18c558f8f990\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"c714d632-dfcf-4eaa-aabf-b48774916e8b\",\"type\":\"CDSView\"}},\"id\":\"decb2ce3-d22f-4aa5-9cf3-9056c8c1e9c7\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"361dfa32-e2e9-45d7-ae85-46dc00768b69\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"d5d6a260-203d-467c-a872-186d3a3be655\",\"elementid\":\"e6a0b8da-622d-4afb-ac75-715c38feebf4\",\"modelid\":\"361dfa32-e2e9-45d7-ae85-46dc00768b69\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "361dfa32-e2e9-45d7-ae85-46dc00768b69" } }, "output_type": "display_data" } ], "source": [ "# 線の種類の設定1\n", "p = figure(plot_width=200, plot_height=200, y_range=[-0.5, 5])\n", "\n", "line_styles = ['solid', 'dashed', 'dotted', 'dotdash', 'dashdot']\n", "\n", "for y, line_style in enumerate(line_styles):\n", " p.line([0, 1], [y, y ], line_dash=line_style)\n", " p.text(0, y, text=[line_style])\n", " \n", "show(p)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"1bd750e0-2684-4893-9f1a-819298fc602a\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"88d72f26-fc87-4c28-a1c4-f020c9662412\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"9551180c-d8f8-466d-9fab-da5b0a70f1d8\",\"type\":\"BoxAnnotation\"}},\"id\":\"6b233338-4e2d-488c-aa11-87f0cf2b663f\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"216d25b8-697f-4392-8de6-cc0db314e9a5\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"c00917d7-b738-441f-8a95-86b94b188e0c\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"9b3a5fe1-47a2-47b0-9156-9755d731ada3\",\"type\":\"ColumnDataSource\"}},\"id\":\"b1a2f469-bda3-4090-a2c7-da677d3e8813\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"48e4e95f-c3b2-43bf-8fdf-fab21b67f1ff\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"9b3a5fe1-47a2-47b0-9156-9755d731ada3\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3cd38d53-f5a4-47c0-8d7e-1326f5c66ce6\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"65bb4a32-1204-43b8-93a1-5f3116c767a5\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"b1a2f469-bda3-4090-a2c7-da677d3e8813\",\"type\":\"CDSView\"}},\"id\":\"be47a7e6-b441-4503-8098-2d790563d85e\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4b5bf859-8649-435a-b255-73a35c4fef5e\",\"type\":\"LinearScale\"},{\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9551180c-d8f8-466d-9fab-da5b0a70f1d8\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"0f95de8f-e59b-4c49-b157-c55947dfcf4a\",\"type\":\"SaveTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e09a3b1e-93e1-4770-841e-2e6eb5f6ab44\",\"type\":\"BasicTicker\"}},\"id\":\"04e753d7-b794-4614-b8e0-83f445aeb649\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"84ba71b3-2b4a-4e4d-a379-7e0892fdf1ac\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"dee3827f-3dd9-4c85-8d0e-9351e55191a9\",\"type\":\"HelpTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[10,2],\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3cd38d53-f5a4-47c0-8d7e-1326f5c66ce6\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null},\"id\":\"eef2d5cd-0a0e-4c3b-939a-4b997369a47c\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"ae8be176-b32b-4949-bd9e-9a213364a1c8\",\"type\":\"BasicTicker\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"216d25b8-697f-4392-8de6-cc0db314e9a5\",\"type\":\"PanTool\"},{\"id\":\"88d72f26-fc87-4c28-a1c4-f020c9662412\",\"type\":\"WheelZoomTool\"},{\"id\":\"6b233338-4e2d-488c-aa11-87f0cf2b663f\",\"type\":\"BoxZoomTool\"},{\"id\":\"0f95de8f-e59b-4c49-b157-c55947dfcf4a\",\"type\":\"SaveTool\"},{\"id\":\"84ba71b3-2b4a-4e4d-a379-7e0892fdf1ac\",\"type\":\"ResetTool\"},{\"id\":\"dee3827f-3dd9-4c85-8d0e-9351e55191a9\",\"type\":\"HelpTool\"}]},\"id\":\"1c57d2ec-bc9d-4f76-98ed-441d9d7caa3b\",\"type\":\"Toolbar\"},{\"attributes\":{\"formatter\":{\"id\":\"c00917d7-b738-441f-8a95-86b94b188e0c\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae8be176-b32b-4949-bd9e-9a213364a1c8\",\"type\":\"BasicTicker\"}},\"id\":\"aff6e46e-ed91-4532-b26d-faa3dee68e94\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"e09a3b1e-93e1-4770-841e-2e6eb5f6ab44\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae8be176-b32b-4949-bd9e-9a213364a1c8\",\"type\":\"BasicTicker\"}},\"id\":\"4ae61de7-de97-4b88-83ea-2febc41a6197\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"48e4e95f-c3b2-43bf-8fdf-fab21b67f1ff\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e09a3b1e-93e1-4770-841e-2e6eb5f6ab44\",\"type\":\"BasicTicker\"}},\"id\":\"0824df59-03c0-4ec0-8d48-53cdaaa31d5f\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"da2e68fb-db65-4066-8b01-f13b8b6a799c\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[1,1]}},\"id\":\"9b3a5fe1-47a2-47b0-9156-9755d731ada3\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null},\"id\":\"91ada60f-ab94-48cb-813c-815b0b313c8b\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"6e189529-d739-4f78-929f-b6215cd23d28\",\"type\":\"Title\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[10,2],\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"65bb4a32-1204-43b8-93a1-5f3116c767a5\",\"type\":\"Line\"},{\"attributes\":{\"below\":[{\"id\":\"aff6e46e-ed91-4532-b26d-faa3dee68e94\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"0824df59-03c0-4ec0-8d48-53cdaaa31d5f\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"aff6e46e-ed91-4532-b26d-faa3dee68e94\",\"type\":\"LinearAxis\"},{\"id\":\"4ae61de7-de97-4b88-83ea-2febc41a6197\",\"type\":\"Grid\"},{\"id\":\"0824df59-03c0-4ec0-8d48-53cdaaa31d5f\",\"type\":\"LinearAxis\"},{\"id\":\"04e753d7-b794-4614-b8e0-83f445aeb649\",\"type\":\"Grid\"},{\"id\":\"9551180c-d8f8-466d-9fab-da5b0a70f1d8\",\"type\":\"BoxAnnotation\"},{\"id\":\"be47a7e6-b441-4503-8098-2d790563d85e\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"6e189529-d739-4f78-929f-b6215cd23d28\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1c57d2ec-bc9d-4f76-98ed-441d9d7caa3b\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"eef2d5cd-0a0e-4c3b-939a-4b997369a47c\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"da2e68fb-db65-4066-8b01-f13b8b6a799c\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"91ada60f-ab94-48cb-813c-815b0b313c8b\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"4b5bf859-8649-435a-b255-73a35c4fef5e\",\"type\":\"LinearScale\"}},\"id\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}],\"root_ids\":[\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"1bd750e0-2684-4893-9f1a-819298fc602a\",\"elementid\":\"2e12fe2b-226d-471e-8002-ee4ad663e3a2\",\"modelid\":\"625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "625e4dc1-c8a8-4414-a3b8-5203fb7c5d0e" } }, "output_type": "display_data" } ], "source": [ "# 線の種類の設定2\n", "p = figure(plot_width=200, plot_height=200)\n", "p.line([0, 1], [1, 1], line_dash=(10, 2), line_width=5) \n", "show(p)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " var docs_json = {\"4d0065e7-a4e5-4c72-8cb6-1deee57a67d3\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2df98876-45f3-488a-95ce-0330e015319b\",\"type\":\"BasicTicker\"}},\"id\":\"7dd92300-f302-4a7c-8b1c-d429f81d9801\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,2],\"line_dash_offset\":5,\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7f3e9935-6d9a-4685-869b-1492da8a1a49\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,2],\"line_dash_offset\":5,\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9971bda0-6071-430f-8cd3-332569736882\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"e85d46f0-2db3-4eb2-811b-4585f2113899\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"b4fdd4f9-d059-49ac-99fd-f2f4cb9f9a68\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"29769530-db62-422b-8c8f-6f78a996d2c2\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"2325358f-b251-4e0c-b8a3-a3ab8c45d079\",\"type\":\"CDSView\"}},\"id\":\"6d51794d-2196-421b-9bc2-da82ccfb56d0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"formatter\":{\"id\":\"42c450e0-e5fb-4660-aa8e-7e72c69cb9af\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ceb79ee3-345f-4bac-865c-40866f745840\",\"type\":\"BasicTicker\"}},\"id\":\"6c6823e5-2d61-4d0c-abb0-4489ff1d05d2\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"end\":1.5,\"start\":-0.5},\"id\":\"30233db8-7000-434e-85fe-c38c3abfe0ab\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"bb5c7c4d-9d6f-419f-98ef-f629b4f41ff3\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"bb8d4950-3f61-4442-8d30-13028b0ca5eb\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"ceb79ee3-345f-4bac-865c-40866f745840\",\"type\":\"BasicTicker\"},{\"attributes\":{\"below\":[{\"id\":\"584b3fc3-5fa1-430c-b846-9e6f5a6acc7a\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"6c6823e5-2d61-4d0c-abb0-4489ff1d05d2\",\"type\":\"LinearAxis\"}],\"plot_height\":200,\"plot_width\":200,\"renderers\":[{\"id\":\"584b3fc3-5fa1-430c-b846-9e6f5a6acc7a\",\"type\":\"LinearAxis\"},{\"id\":\"7dd92300-f302-4a7c-8b1c-d429f81d9801\",\"type\":\"Grid\"},{\"id\":\"6c6823e5-2d61-4d0c-abb0-4489ff1d05d2\",\"type\":\"LinearAxis\"},{\"id\":\"57e448f5-6ab9-49ad-b3b1-9f899f376e87\",\"type\":\"Grid\"},{\"id\":\"90340fda-59d2-40e0-88c1-aae643977b3b\",\"type\":\"BoxAnnotation\"},{\"id\":\"6d51794d-2196-421b-9bc2-da82ccfb56d0\",\"type\":\"GlyphRenderer\"},{\"id\":\"a9b932cf-a252-406b-bfc8-ad8da220b17c\",\"type\":\"GlyphRenderer\"},{\"id\":\"97cf050f-2dd5-4423-ad03-91f2fc3fa65f\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"88fe3c6d-02cb-4e11-8434-e9212e810878\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"a12fffd0-42e6-44e8-b7e1-6f8a0fe34fe9\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"30233db8-7000-434e-85fe-c38c3abfe0ab\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"bb5c7c4d-9d6f-419f-98ef-f629b4f41ff3\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"8fb08fbb-f7d6-43d7-8594-60f7fafa16f3\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"bb8d4950-3f61-4442-8d30-13028b0ca5eb\",\"type\":\"LinearScale\"}},\"id\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"formatter\":{\"id\":\"c2651e0d-d6d8-4254-a93d-53a89c0878a5\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2df98876-45f3-488a-95ce-0330e015319b\",\"type\":\"BasicTicker\"}},\"id\":\"584b3fc3-5fa1-430c-b846-9e6f5a6acc7a\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2df98876-45f3-488a-95ce-0330e015319b\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ceb79ee3-345f-4bac-865c-40866f745840\",\"type\":\"BasicTicker\"}},\"id\":\"57e448f5-6ab9-49ad-b3b1-9f899f376e87\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[2,2]}},\"id\":\"f8389ce6-79f1-457e-88ca-3b32baca785e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"e85d46f0-2db3-4eb2-811b-4585f2113899\",\"type\":\"ColumnDataSource\"}},\"id\":\"2325358f-b251-4e0c-b8a3-a3ab8c45d079\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"41d7d5de-ec87-41e9-9969-3914e1cabd8f\",\"type\":\"PanTool\"},{\"id\":\"67c22bdd-2a67-4d31-8f6b-1c8e0e7e1172\",\"type\":\"WheelZoomTool\"},{\"id\":\"8ff4282d-ce1e-4587-824d-6e0aca5122ca\",\"type\":\"BoxZoomTool\"},{\"id\":\"bf8e2f92-c75a-408d-9ab7-d389f1aaaa00\",\"type\":\"SaveTool\"},{\"id\":\"66700c3e-2818-4f00-8d25-cc8683978422\",\"type\":\"ResetTool\"},{\"id\":\"0c0eb545-1537-46a7-8816-96703976ce5b\",\"type\":\"HelpTool\"}]},\"id\":\"a12fffd0-42e6-44e8-b7e1-6f8a0fe34fe9\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,5],\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"29769530-db62-422b-8c8f-6f78a996d2c2\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"42c450e0-e5fb-4660-aa8e-7e72c69cb9af\",\"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},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"90340fda-59d2-40e0-88c1-aae643977b3b\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"41d7d5de-ec87-41e9-9969-3914e1cabd8f\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"c2651e0d-d6d8-4254-a93d-53a89c0878a5\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"67c22bdd-2a67-4d31-8f6b-1c8e0e7e1172\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"90340fda-59d2-40e0-88c1-aae643977b3b\",\"type\":\"BoxAnnotation\"}},\"id\":\"8ff4282d-ce1e-4587-824d-6e0aca5122ca\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"bf8e2f92-c75a-408d-9ab7-d389f1aaaa00\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"66700c3e-2818-4f00-8d25-cc8683978422\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"0c0eb545-1537-46a7-8816-96703976ce5b\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[1,1]}},\"id\":\"2c5e19fe-639f-453c-af10-96bee7a93a12\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"88fe3c6d-02cb-4e11-8434-e9212e810878\",\"type\":\"Title\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,5],\"line_dash_offset\":-5,\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d53fe076-1b57-4c94-acd3-387eada4c1b4\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"f8389ce6-79f1-457e-88ca-3b32baca785e\",\"type\":\"ColumnDataSource\"}},\"id\":\"21003b4d-adcc-4992-a22e-6199fb8c3ec6\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,5],\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"b4fdd4f9-d059-49ac-99fd-f2f4cb9f9a68\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[20,5],\"line_dash_offset\":-5,\"line_width\":{\"value\":5},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"371e04e8-c11d-43e3-8a23-f1520dcb1edf\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2c5e19fe-639f-453c-af10-96bee7a93a12\",\"type\":\"ColumnDataSource\"}},\"id\":\"8b20bb8b-4c46-482f-9684-e212c436809d\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"f8389ce6-79f1-457e-88ca-3b32baca785e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d53fe076-1b57-4c94-acd3-387eada4c1b4\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"371e04e8-c11d-43e3-8a23-f1520dcb1edf\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"21003b4d-adcc-4992-a22e-6199fb8c3ec6\",\"type\":\"CDSView\"}},\"id\":\"a9b932cf-a252-406b-bfc8-ad8da220b17c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2c5e19fe-639f-453c-af10-96bee7a93a12\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7f3e9935-6d9a-4685-869b-1492da8a1a49\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"9971bda0-6071-430f-8cd3-332569736882\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"8b20bb8b-4c46-482f-9684-e212c436809d\",\"type\":\"CDSView\"}},\"id\":\"97cf050f-2dd5-4423-ad03-91f2fc3fa65f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"8fb08fbb-f7d6-43d7-8594-60f7fafa16f3\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[0,1],\"y\":[3,3]}},\"id\":\"e85d46f0-2db3-4eb2-811b-4585f2113899\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"f978eb57-ebcb-4dbd-a05c-042346adeadb\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n", " var render_items = [{\"docid\":\"4d0065e7-a4e5-4c72-8cb6-1deee57a67d3\",\"elementid\":\"d6fedc8f-715b-4b53-baa5-53c90ae52505\",\"modelid\":\"f978eb57-ebcb-4dbd-a05c-042346adeadb\"}];\n", "\n", " root.Bokeh.embed.embed_items(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 embed document 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": "f978eb57-ebcb-4dbd-a05c-042346adeadb" } }, "output_type": "display_data" } ], "source": [ "#線の種類の設定\n", "p = figure(plot_width=200, plot_height=200, x_range=(-0.5, 1.5))\n", "p.line([0, 1], [3, 3], line_dash=(20, 5), line_width=5)\n", "p.line([0, 1], [2, 2], line_dash=(20, 5), line_dash_offset=(-5), line_width=5)\n", "p.line([0, 1], [1, 1], line_dash=(20, 2), line_dash_offset=(5), line_width=5) \n", "show(p)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }