bokeh.palettes

Provide a collection of palettes for color mapping.

Palettes are simple plain Python lists of (hex) RGB colors. This module containts the following sets of palettes:

  • All Brewer palettes
  • Magma
  • Inferno
  • Plasma
  • Viridis

Every pre-built palette is available as a module attributes, e.g. bokeh.palettes.YlGn3 or bokeh.palettes.Viridis256. The name of every all pre-built palettes can be found in the __palettes__ module attribute.

There are functions magma(), inferno(), plasma(), viridis() that can generate lists of colors of arbitrary size from those palettes.

The Brewer palettes are also collected and grouped by name in a brewer dictionary, e.g.: brewer['Spectral'][6]

Finally, all “small” palettes (i.e. excluding the 256 color ones) are collected and grouped similarly in a small_palettes attribute. The complete contents of small_palettes is show below.


"
Blues
3
4
5
6
7
8
9
BrBG
3
4
5
6
7
8
9
10
11
BuGn
3
4
5
6
7
8
9
BuPu
3
4
5
6
7
8
9
GnBu
3
4
5
6
7
8
9
Greens
3
4
5
6
7
8
9
Greys
3
4
5
6
7
8
9
Inferno
3
4
5
6
7
8
9
10
11
Magma
3
4
5
6
7
8
9
10
11
OrRd
3
4
5
6
7
8
9
Oranges
3
4
5
6
7
8
9
PRGn
3
4
5
6
7
8
9
10
11
PiYG
3
4
5
6
7
8
9
10
11
Plasma
3
4
5
6
7
8
9
10
11
PuBu
3
4
5
6
7
8
9
PuBuGn
3
4
5
6
7
8
9
PuOr
3
4
5
6
7
8
9
10
11
PuRd
3
4
5
6
7
8
9
Purples
3
4
5
6
7
8
9
RdBu
3
4
5
6
7
8
9
10
11
RdGy
3
4
5
6
7
8
9
10
11
RdPu
3
4
5
6
7
8
9
RdYlBu
3
4
5
6
7
8
9
10
11
RdYlGn
3
4
5
6
7
8
9
10
11
Reds
3
4
5
6
7
8
9
Spectral
3
4
5
6
7
8
9
10
11
Viridis
3
4
5
6
7
8
9
10
11
YlGn
3
4
5
6
7
8
9
YlGnBu
3
4
5
6
7
8
9
YlOrBr
3
4
5
6
7
8
9
YlOrRd
3
4
5
6
7
8
9
inferno(n)

Return a palette of n equally spaced colors.

magma(n)

Return a palette of n equally spaced colors.

plasma(n)

Return a palette of n equally spaced colors.

viridis(n)

Return a palette of n equally spaced colors.