bokeh.models.mappers

Models for mapping values from one range or space to another.

class ColorMapper(**kwargs)

Bases: bokeh.plot_object.PlotObject

Base class for color mapper types. ColorMapper` is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "doc": null,
      "id": "e798cc62-209f-42f5-9f2f-8ccc14a3fd2e",
      "name": null,
      "tags": []
    },
    "id": "e798cc62-209f-42f5-9f2f-8ccc14a3fd2e",
    "type": "ColorMapper"
  }
]
class LinearColorMapper(palette=None, **kwargs)

Bases: bokeh.models.mappers.ColorMapper

Map numbers in a range [low, high] linearly into a sequence of colors (a palette).

For example, if the range is [0, 99] and the palette is ['red', 'green', 'blue'], the values would be mapped as follows:

      x < 0  : 'red'     # values < low are clamped
 0 >= x < 33 : 'red'
33 >= x < 66 : 'green'
66 >= x < 99 : 'blue'
99 >= x      : 'blue'    # values > high are clamped
high

property type: Float

The maximum value of the range to map into the palette. Values above this are clamped to high.

low

property type: Float

The minimum value of the range to map into the palette. Values below this are clamped to low.

palette

property type: Seq(Color)

A sequence of colors to use as the target palette for mapping.

This property can also be set as a String, to the name of any of the palettes shown in Standard Palettes.

reserve_color

property type: Color

Used by Abstract Rendering.

reserve_val

property type: Float

Used by Abstract Rendering.

[
  {
    "attributes": {
      "doc": null,
      "high": null,
      "id": "08e2af7e-b549-45d2-a591-de8e51745820",
      "low": null,
      "name": null,
      "palette": null,
      "reserve_color": "#ffffff",
      "reserve_val": null,
      "tags": []
    },
    "id": "08e2af7e-b549-45d2-a591-de8e51745820",
    "type": "LinearColorMapper"
  }
]