bokeh.models.mappers¶Models for mapping values from one range or space to another.
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": "76dc51cf-2b88-4ecf-bad4-b92498ef5a60",
"name": null,
"tags": []
},
"id": "76dc51cf-2b88-4ecf-bad4-b92498ef5a60",
"type": "ColorMapper"
}
]
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¶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.
[
{
"attributes": {
"doc": null,
"high": null,
"id": "159ec706-9bf1-4435-903c-2e17d8945b60",
"low": null,
"name": null,
"palette": null,
"reserve_color": "#ffffff",
"reserve_val": null,
"tags": []
},
"id": "159ec706-9bf1-4435-903c-2e17d8945b60",
"type": "LinearColorMapper"
}
]