bokeh.models.tickers

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

class AdaptiveTicker(**kwargs)

Bases: bokeh.models.tickers.ContinuousTicker

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: base:Float

The multiplier to use for scaling mantissas.

mantissas

property type: mantissas:Seq(Float)

The acceptable list numbers to generate multiples of.

max_interval

property type: max_interval:Float

The largest allowable interval between two adjacent ticks.

Note

To specify an unbounded interval, set to None.

min_interval

property type: min_interval:Float

The smallest allowable interval between two adjacent ticks.

JSON Prototype
{
  "base": 10.0,
  "desired_num_ticks": 6,
  "id": "6aba05b7-9386-463a-9816-444717b0fdee",
  "mantissas": [
    1,
    2,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
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.

JSON Prototype
{
  "base": 10.0,
  "desired_num_ticks": 6,
  "id": "1da24371-3fea-49b4-b3e1-51164f52fbde",
  "mantissas": [
    1,
    2,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class CategoricalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate ticks for categorical ranges.

JSON Prototype
{
  "id": "f4bb62db-b902-4eb7-9900-20560d9bf1ea",
  "name": null,
  "tags": []
}
class CompositeTicker(**kwargs)

Bases: bokeh.models.tickers.ContinuousTicker

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: tickers: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()
JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "61626206-4b0d-4744-908e-7a17b1686a6e",
  "name": null,
  "num_minor_ticks": 5,
  "tags": [],
  "tickers": []
}
class ContinuousTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

A base class for non-categorical ticker types. ContinuousTicker is not generally useful to instantiate on its own.

desired_num_ticks

property type: desired_num_ticks:Int

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

num_minor_ticks

property type: num_minor_ticks:Int

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

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "7be854f0-760d-4012-8bc4-6ee1104937e6",
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class DatetimeTicker(**kwargs)

Bases: bokeh.models.tickers.CompositeTicker

Generate nice ticks across different date and time scales.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "3654ad44-4b01-4998-aebb-30321a0e2ed4",
  "name": null,
  "num_minor_ticks": 0,
  "tags": [],
  "tickers": [
    {
      "id": "923762ab-4cca-4538-ac7a-c600f45d86ed",
      "type": "AdaptiveTicker"
    },
    {
      "id": "5f03c801-97e2-4070-9738-656879afbe06",
      "type": "AdaptiveTicker"
    },
    {
      "id": "ca1be593-f1e9-4632-b683-dee13235977e",
      "type": "AdaptiveTicker"
    },
    {
      "id": "f198187e-5db3-4fb8-becd-4e0b814e4a7b",
      "type": "DaysTicker"
    },
    {
      "id": "bd0de5da-9cae-46b5-b24f-00f646ed9536",
      "type": "DaysTicker"
    },
    {
      "id": "b961963c-261c-4a1e-bde6-41597d68650f",
      "type": "DaysTicker"
    },
    {
      "id": "e4b1bbc5-5c89-406c-a23f-47477f512598",
      "type": "DaysTicker"
    },
    {
      "id": "c7d8a692-0a24-4daa-82a5-64334957b05f",
      "type": "MonthsTicker"
    },
    {
      "id": "d1ba0f30-56dd-468f-a3da-41ee0ca04a44",
      "type": "MonthsTicker"
    },
    {
      "id": "1c22feef-5411-4518-90c2-9a3caa4bdafa",
      "type": "MonthsTicker"
    },
    {
      "id": "ab6fce21-7d4f-4318-a869-5f5fad3a93fd",
      "type": "MonthsTicker"
    },
    {
      "id": "a60e5b13-5afd-47f2-a1d4-2b8d55f28477",
      "type": "YearsTicker"
    }
  ]
}
class DaysTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

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

days

property type: days:Seq(Int)

The intervals of days to use.

JSON Prototype
{
  "days": [],
  "desired_num_ticks": 6,
  "id": "04e4c1f0-15b6-4925-9424-185ad437bf84",
  "interval": null,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class FixedTicker(**kwargs)

Bases: bokeh.models.tickers.ContinuousTicker

Generate ticks at fixed, explicitly supplied locations.

Note

The desired_num_ticks property is ignored by this Ticker.

ticks

property type: ticks:Seq(Float)

List of tick locations.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "1a2dc2f9-cce8-444a-ad17-e2e96d9b82b5",
  "name": null,
  "num_minor_ticks": 5,
  "tags": [],
  "ticks": []
}
class LogTicker(**kwargs)

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a log scale.

JSON Prototype
{
  "base": 10.0,
  "desired_num_ticks": 6,
  "id": "c88cb89c-965d-42fc-99c4-7fc5277897ba",
  "mantissas": [
    1,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class MonthsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

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

months

property type: months:Seq(Int)

The intervals of months to use.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "9bd5b87a-74dd-409b-8670-ecbf30d994b0",
  "interval": null,
  "months": [],
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class SingleIntervalTicker(**kwargs)

Bases: bokeh.models.tickers.ContinuousTicker

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

interval

property type: interval:Float

The interval between adjacent ticks.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "d81e4725-d321-4df4-8048-c18c00ca18c7",
  "interval": null,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class Ticker(**kwargs)

Bases: bokeh.model.Model

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

JSON Prototype
{
  "id": "c5248526-5e5b-4cbc-8a5b-65e788b4720a",
  "name": null,
  "tags": []
}
class YearsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart even numbers of years.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "2baa5798-b52a-49cf-8240-78dbc6a1fafb",
  "interval": null,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}