You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notebooks/05_styling.ipynb
+26-8Lines changed: 26 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
{
2
2
"cells": [
3
3
{
4
+
"attachments": {},
4
5
"cell_type": "markdown",
5
6
"metadata": {},
6
7
"source": [
@@ -46,6 +47,7 @@
46
47
]
47
48
},
48
49
{
50
+
"attachments": {},
49
51
"cell_type": "markdown",
50
52
"metadata": {},
51
53
"source": [
@@ -59,6 +61,7 @@
59
61
]
60
62
},
61
63
{
64
+
"attachments": {},
62
65
"cell_type": "markdown",
63
66
"metadata": {},
64
67
"source": [
@@ -99,6 +102,7 @@
99
102
]
100
103
},
101
104
{
105
+
"attachments": {},
102
106
"cell_type": "markdown",
103
107
"metadata": {},
104
108
"source": [
@@ -107,6 +111,7 @@
107
111
]
108
112
},
109
113
{
114
+
"attachments": {},
110
115
"cell_type": "markdown",
111
116
"metadata": {},
112
117
"source": [
@@ -154,6 +159,7 @@
154
159
]
155
160
},
156
161
{
162
+
"attachments": {},
157
163
"cell_type": "markdown",
158
164
"metadata": {},
159
165
"source": [
@@ -225,6 +231,7 @@
225
231
]
226
232
},
227
233
{
234
+
"attachments": {},
228
235
"cell_type": "markdown",
229
236
"metadata": {},
230
237
"source": [
@@ -260,13 +267,15 @@
260
267
]
261
268
},
262
269
{
270
+
"attachments": {},
263
271
"cell_type": "markdown",
264
272
"metadata": {},
265
273
"source": [
266
274
"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."
267
275
]
268
276
},
269
277
{
278
+
"attachments": {},
270
279
"cell_type": "markdown",
271
280
"metadata": {},
272
281
"source": [
@@ -315,6 +324,7 @@
315
324
]
316
325
},
317
326
{
327
+
"attachments": {},
318
328
"cell_type": "markdown",
319
329
"metadata": {},
320
330
"source": [
@@ -323,6 +333,7 @@
323
333
]
324
334
},
325
335
{
336
+
"attachments": {},
326
337
"cell_type": "markdown",
327
338
"metadata": {},
328
339
"source": [
@@ -356,6 +367,7 @@
356
367
]
357
368
},
358
369
{
370
+
"attachments": {},
359
371
"cell_type": "markdown",
360
372
"metadata": {},
361
373
"source": [
@@ -411,6 +423,7 @@
411
423
]
412
424
},
413
425
{
426
+
"attachments": {},
414
427
"cell_type": "markdown",
415
428
"metadata": {},
416
429
"source": [
@@ -419,6 +432,7 @@
419
432
]
420
433
},
421
434
{
435
+
"attachments": {},
422
436
"cell_type": "markdown",
423
437
"metadata": {},
424
438
"source": [
@@ -468,6 +482,7 @@
468
482
]
469
483
},
470
484
{
485
+
"attachments": {},
471
486
"cell_type": "markdown",
472
487
"metadata": {},
473
488
"source": [
@@ -477,6 +492,7 @@
477
492
]
478
493
},
479
494
{
495
+
"attachments": {},
480
496
"cell_type": "markdown",
481
497
"metadata": {},
482
498
"source": [
@@ -561,6 +577,7 @@
561
577
]
562
578
},
563
579
{
580
+
"attachments": {},
564
581
"cell_type": "markdown",
565
582
"metadata": {},
566
583
"source": [
@@ -570,6 +587,7 @@
570
587
]
571
588
},
572
589
{
590
+
"attachments": {},
573
591
"cell_type": "markdown",
574
592
"metadata": {},
575
593
"source": [
@@ -600,6 +618,7 @@
600
618
]
601
619
},
602
620
{
621
+
"attachments": {},
603
622
"cell_type": "markdown",
604
623
"metadata": {},
605
624
"source": [
@@ -644,20 +663,17 @@
644
663
]
645
664
},
646
665
{
666
+
"attachments": {},
647
667
"cell_type": "markdown",
648
668
"metadata": {},
649
669
"source": [
650
670
"To provide information about what color maps to which numerical value, you can add a\n",
651
671
"color bar to your plot.\n",
652
672
"\n",
653
-
"To add a color bar, use the ``construct_color_bar()`` method of your glyph. \n",
654
-
"\n",
655
673
"Adding a color bar is a two-step process:\n",
656
674
"\n",
657
-
"1. Defining the color bar as a ``ColorBar`` object. Use the `color_mapper`\n",
658
-
" parameter to define the color mapper to use. In this case, you use the\n",
659
-
" color mapper transform associated with the glyph.\n",
660
-
"2. Adding the `ColorBar` object to the figure. Use the `add_layout` method to\n",
675
+
"1. Defining the color bar with the ``construct_color_bar()`` method\n",
676
+
"2. Adding the color bar to the figure. Use the `add_layout` method to\n",
661
677
" add the object and define its position."
662
678
]
663
679
},
@@ -667,15 +683,14 @@
667
683
"metadata": {},
668
684
"outputs": [],
669
685
"source": [
670
-
"from bokeh.models import ColorBar # only needed to create a ColorBar directly rather than using construct_color_bar\n",
671
-
"\n",
672
686
"color_bar = circle_scatter.construct_color_bar() # create a color bar based on the glyph's color mapper\n",
673
687
"mapper_plot.add_layout(obj=color_bar, place=\"right\") # add the color bar to the plot you created above\n",
0 commit comments