bokeh.models.tickers

Models for computing good tick locations on different kinds of plots.

class AdaptiveTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate “nice” round ticks at any magnitude.

Creates ticks that are “base” multiples of a set of given mantissas. For example, with base=10 and mantissas=[1, 2, 5], the ticker will generate the sequence:

..., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, ...
base

property type: Float

The multiplier to use for scaling mantissas.

mantissas

property type: Seq(Float)

The acceptable list numbers to generate multiples of.

max_interval

property type: Float

The largest allowable interval between two adjacent ticks.

min_interval

property type: Float

The smallest allowable interval between two adjacent ticks.

[
  {
    "attributes": {
      "base": 10.0,
      "desired_num_ticks": 6,
      "doc": null,
      "id": "f436c4cd-d341-4c08-b3c3-49a1ca2e769d",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "f436c4cd-d341-4c08-b3c3-49a1ca2e769d",
    "type": "AdaptiveTicker"
  }
]
class BasicTicker(**kwargs)

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a linear scale.

Note

This class may be renamed to LinearTicker in the future.

[
  {
    "attributes": {
      "base": 10.0,
      "desired_num_ticks": 6,
      "doc": null,
      "id": "2a0938be-2829-41dc-bb53-c7a8b1ae1a7e",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "2a0938be-2829-41dc-bb53-c7a8b1ae1a7e",
    "type": "BasicTicker"
  }
]
class CategoricalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate ticks for categorical ranges.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "979c9ad0-ba98-49b5-bb80-157ffa2d4237",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "979c9ad0-ba98-49b5-bb80-157ffa2d4237",
    "type": "CategoricalTicker"
  }
]
class CompositeTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Combine different tickers at different scales.

Uses the min_interval and max_interval interval attributes of the tickers to select the appropriate ticker at different scales.

tickers

property type: Seq(Instance(Ticker))

A list of Ticker objects to combine at different scales in order to generate tick values. The supplied tickers should be in order. Specifically, if S comes before T, then it should be the case that:

S.get_max_interval() < T.get_min_interval()
[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "acac5bfe-122d-4cff-aa46-9d145a41e436",
      "name": null,
      "num_minor_ticks": 5,
      "tags": [],
      "tickers": null
    },
    "id": "acac5bfe-122d-4cff-aa46-9d145a41e436",
    "type": "CompositeTicker"
  }
]
class DatetimeTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate nice ticks across different date and time scales.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "dd9b0816-1661-4caa-a3da-fd01115d2688",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "dd9b0816-1661-4caa-a3da-fd01115d2688",
    "type": "DatetimeTicker"
  }
]
class DaysTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart by specific, even multiples of days.

days

property type: Seq(Int)

The intervals of days to use.

[
  {
    "attributes": {
      "days": null,
      "desired_num_ticks": 6,
      "doc": null,
      "id": "eab3146b-e982-4264-994e-93f66a8d97a3",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "eab3146b-e982-4264-994e-93f66a8d97a3",
    "type": "DaysTicker"
  }
]
class FixedTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate ticks at fixed, explicitly supplied locations.

Note

The desired_num_ticks property is ignored by this Ticker.

ticks

property type: Seq(Float)

List of tick locations.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "3c185782-22c5-4b89-abca-aa113f6611bf",
      "name": null,
      "num_minor_ticks": 5,
      "tags": [],
      "ticks": null
    },
    "id": "3c185782-22c5-4b89-abca-aa113f6611bf",
    "type": "FixedTicker"
  }
]
class LogTicker(**kwargs)

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a log scale.

[
  {
    "attributes": {
      "base": 10.0,
      "desired_num_ticks": 6,
      "doc": null,
      "id": "3184e4cd-3129-4d03-9d3a-2db125ab0626",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "3184e4cd-3129-4d03-9d3a-2db125ab0626",
    "type": "LogTicker"
  }
]
class MonthsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart by specific, even multiples of months.

months

property type: Seq(Int)

The intervals of months to use.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "aa9115c6-485a-4b0c-99ce-e180dfcee653",
      "interval": null,
      "months": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "aa9115c6-485a-4b0c-99ce-e180dfcee653",
    "type": "MonthsTicker"
  }
]
class SingleIntervalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate evenly spaced ticks at a fixed interval regardless of scale.

interval

property type: Float

The interval between adjacent ticks.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "f093a4d9-b39e-45cf-af7c-f942d387dcad",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "f093a4d9-b39e-45cf-af7c-f942d387dcad",
    "type": "SingleIntervalTicker"
  }
]
class Ticker(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all ticker types. Ticker is not generally useful to instantiate on its own.

desired_num_ticks

property type: Int

A desired target number of major tick positions to generate across the plot range.

num_minor_ticks

property type: Int

The number of minor tick positions to generate between adjacent major tick values.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "0c0ed6ef-9af2-4362-969a-49c1a3000261",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "0c0ed6ef-9af2-4362-969a-49c1a3000261",
    "type": "Ticker"
  }
]
class YearsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart even numbers of years.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "ef5fb01e-5a03-46b3-900b-15e7be1c4900",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "ef5fb01e-5a03-46b3-900b-15e7be1c4900",
    "type": "YearsTicker"
  }
]