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": "61554e26-d330-4c95-958d-6fabee445a45",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "61554e26-d330-4c95-958d-6fabee445a45",
    "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": "47c1710d-8007-4aa6-9dff-8624403cad83",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "47c1710d-8007-4aa6-9dff-8624403cad83",
    "type": "BasicTicker"
  }
]
class CategoricalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate ticks for categorical ranges.

[
  {
    "attributes": {
      "desired_num_ticks": 6,
      "doc": null,
      "id": "1472fcf0-d17c-49b1-9a57-2362e28c404a",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "1472fcf0-d17c-49b1-9a57-2362e28c404a",
    "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": "39d6249e-4559-4489-aefb-c5e54a18a045",
      "name": null,
      "num_minor_ticks": 5,
      "tags": [],
      "tickers": null
    },
    "id": "39d6249e-4559-4489-aefb-c5e54a18a045",
    "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": "124fd83b-ab0a-4aee-8b41-356a51d30413",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "124fd83b-ab0a-4aee-8b41-356a51d30413",
    "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": "958c2fd5-418d-4637-9383-cfc7e763b602",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "958c2fd5-418d-4637-9383-cfc7e763b602",
    "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": "cd9a97bf-8226-4d7e-8338-d8c5b9eb53d5",
      "name": null,
      "num_minor_ticks": 5,
      "tags": [],
      "ticks": null
    },
    "id": "cd9a97bf-8226-4d7e-8338-d8c5b9eb53d5",
    "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": "930d7555-ece9-48eb-b2d8-781f38b38afe",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "930d7555-ece9-48eb-b2d8-781f38b38afe",
    "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": "8f28960c-de8a-42df-9e71-3e081c5a69df",
      "interval": null,
      "months": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "8f28960c-de8a-42df-9e71-3e081c5a69df",
    "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": "8421d5c2-57cd-499a-a418-325e088915db",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "8421d5c2-57cd-499a-a418-325e088915db",
    "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": "35cdc42d-0b7f-48f0-8029-d39599a5df3e",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "35cdc42d-0b7f-48f0-8029-d39599a5df3e",
    "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": "1d03333d-fa06-4670-9d47-b3368011c0c7",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "1d03333d-fa06-4670-9d47-b3368011c0c7",
    "type": "YearsTicker"
  }
]