Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions notebooks/05_styling.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -46,6 +47,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -59,6 +61,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -99,6 +102,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -107,6 +111,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -154,6 +159,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -225,6 +231,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -260,13 +267,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"See the [Styling plot elements](https://docs.bokeh.org/en/latest/docs/user_guide/styling/plots.html#ug-styling-plots) section of the user guide for more details."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -315,6 +324,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -323,6 +333,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -356,6 +367,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -411,6 +423,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -419,6 +432,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -468,6 +482,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -477,6 +492,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -561,6 +577,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -570,6 +587,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -600,6 +618,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -644,20 +663,17 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"To provide information about what color maps to which numerical value, you can add a\n",
"color bar to your plot.\n",
"\n",
"To add a color bar, use the ``construct_color_bar()`` method of your glyph. \n",
"\n",
"Adding a color bar is a two-step process:\n",
"\n",
"1. Defining the color bar as a ``ColorBar`` object. Use the `color_mapper`\n",
" parameter to define the color mapper to use. In this case, you use the\n",
" color mapper transform associated with the glyph.\n",
"2. Adding the `ColorBar` object to the figure. Use the `add_layout` method to\n",
"1. Defining the color bar with the ``construct_color_bar()`` method\n",
"2. Adding the color bar to the figure. Use the `add_layout` method to\n",
" add the object and define its position."
]
},
Expand All @@ -667,15 +683,14 @@
"metadata": {},
"outputs": [],
"source": [
"from bokeh.models import ColorBar # only needed to create a ColorBar directly rather than using construct_color_bar\n",
"\n",
"color_bar = circle_scatter.construct_color_bar() # create a color bar based on the glyph's color mapper\n",
"mapper_plot.add_layout(obj=color_bar, place=\"right\") # add the color bar to the plot you created above\n",
"\n",
"show(mapper_plot)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -684,6 +699,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -737,6 +753,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -746,6 +763,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down