bokeh.models.tickers

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

class AdaptiveTicker(**kwargs)[source]

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: 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.

Note

To specify an unbounded interval, set to None.

min_interval

property type: Float

The smallest allowable interval between two adjacent ticks.

JSON Prototype
{
  "base": 10.0,
  "desired_num_ticks": 6,
  "id": "e4f79663-72c1-43fd-81f7-17770e411eb0",
  "js_callbacks": {},
  "mantissas": [
    1,
    2,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class BasicTicker(**kwargs)[source]

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": "e3b632c8-de4c-45cd-b088-c4201380ac0f",
  "js_callbacks": {},
  "mantissas": [
    1,
    2,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class CategoricalTicker(**kwargs)[source]

Bases: bokeh.models.tickers.Ticker

Generate ticks for categorical ranges.

JSON Prototype
{
  "id": "e290cb7e-986a-4835-b6f8-bf3e179b3237",
  "js_callbacks": {},
  "name": null,
  "tags": []
}
class CompositeTicker(**kwargs)[source]

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: 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": "c68f8f81-9cb0-41fd-8460-cea111cfae51",
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": [],
  "tickers": []
}
class ContinuousTicker(**kwargs)[source]

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: 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.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "04c33cb0-2cea-4849-8952-90b0fc1d522e",
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class DatetimeTicker(**kwargs)[source]

Bases: bokeh.models.tickers.CompositeTicker

Generate nice ticks across different date and time scales.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "e19b26f6-b745-4269-9ee5-eacebff5c298",
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 0,
  "tags": [],
  "tickers": [
    {
      "id": "e13dfec1-f2a9-4766-bed3-4f0b3b29d7b7",
      "type": "AdaptiveTicker"
    },
    {
      "id": "d3fc30f9-203e-479d-8882-155145484a09",
      "type": "AdaptiveTicker"
    },
    {
      "id": "ebdd82f6-1de4-4c4f-b680-80720ab0926f",
      "type": "AdaptiveTicker"
    },
    {
      "id": "061c100e-4031-4f21-a593-7c2210d8df8f",
      "type": "DaysTicker"
    },
    {
      "id": "882670d8-d5f2-4642-b0d3-627a6585493a",
      "type": "DaysTicker"
    },
    {
      "id": "01ba8333-84c8-4729-b2fc-b572137306a5",
      "type": "DaysTicker"
    },
    {
      "id": "774f16b5-f36f-413a-8388-aa23daf2077c",
      "type": "DaysTicker"
    },
    {
      "id": "8d777901-3dc2-4f54-a77e-31b6760d52af",
      "type": "MonthsTicker"
    },
    {
      "id": "384e89e3-f76e-4a1c-9587-1fb448e16c25",
      "type": "MonthsTicker"
    },
    {
      "id": "c5bfee2f-168b-4a1f-aea9-b5dc57c93036",
      "type": "MonthsTicker"
    },
    {
      "id": "e147212e-957e-4e91-8dc1-e5b9f43cc44d",
      "type": "MonthsTicker"
    },
    {
      "id": "0c715e8a-0ff0-4a88-b6f8-cc1f37f7793b",
      "type": "YearsTicker"
    }
  ]
}
class DaysTicker(**kwargs)[source]

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.

JSON Prototype
{
  "days": [],
  "desired_num_ticks": 6,
  "id": "e2f8f3a0-5f9c-47cd-be38-da207786698e",
  "interval": null,
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class FixedTicker(**kwargs)[source]

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: Seq ( Float )

List of tick locations.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "ea6ac89d-69fb-4ff7-ab80-2439b9ea5bb8",
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": [],
  "ticks": []
}
class LogTicker(**kwargs)[source]

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a log scale.

JSON Prototype
{
  "base": 10.0,
  "desired_num_ticks": 6,
  "id": "6e80afcc-b9ce-437b-a22e-be088395f01c",
  "js_callbacks": {},
  "mantissas": [
    1,
    5
  ],
  "max_interval": null,
  "min_interval": 0.0,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class MonthsTicker(**kwargs)[source]

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.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "584a55f6-7cab-4a7f-b9f7-754a9e4db8e1",
  "interval": null,
  "js_callbacks": {},
  "months": [],
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class SingleIntervalTicker(**kwargs)[source]

Bases: bokeh.models.tickers.ContinuousTicker

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

interval

property type: Float

The interval between adjacent ticks.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "aca4753b-ad29-449f-a40b-01f2cd4d51ff",
  "interval": null,
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}
class Ticker(**kwargs)[source]

Bases: bokeh.model.Model

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

JSON Prototype
{
  "id": "437fc766-782a-4592-a0d1-f96f3054eddc",
  "js_callbacks": {},
  "name": null,
  "tags": []
}
class YearsTicker(**kwargs)[source]

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart even numbers of years.

JSON Prototype
{
  "desired_num_ticks": 6,
  "id": "51e818e7-3f5a-48bd-8cca-fdd9168ea077",
  "interval": null,
  "js_callbacks": {},
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}