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": "c9de462f-f382-4842-ba4c-8b96b1a59fce",
  "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": "26190e9f-98de-4b44-868c-10d66125344d",
  "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": "87cb34f6-f0cb-4af3-b232-cba8aff4cb19",
  "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": "834b339e-6db6-4861-89d4-e5e6f328d66a",
  "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": "d4313773-3bc8-4e86-a268-5ab9ab42b1d9",
  "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": "967cf9dc-3c22-4cc4-999d-8a1aaef5be58",
  "name": null,
  "num_minor_ticks": 0,
  "tags": [],
  "tickers": [
    {
      "id": "427d4e87-08df-4a37-a135-435cc3105d1f",
      "type": "AdaptiveTicker"
    },
    {
      "id": "6e9ffb7e-bd2c-4e86-b8e0-81ac880ee835",
      "type": "AdaptiveTicker"
    },
    {
      "id": "af08ed4f-021c-41bb-8d40-7852081bc968",
      "type": "AdaptiveTicker"
    },
    {
      "id": "654459eb-1498-4bb8-a2c6-b16dab6a9195",
      "type": "DaysTicker"
    },
    {
      "id": "f1263b79-6ce1-4799-a1d0-6c7af2de50f6",
      "type": "DaysTicker"
    },
    {
      "id": "f73a1f48-5f70-4143-bc15-687715576a9c",
      "type": "DaysTicker"
    },
    {
      "id": "a58f3498-8531-4d24-a5f8-e4851921d4d4",
      "type": "DaysTicker"
    },
    {
      "id": "31f2746e-e8a0-47b4-8390-ba858a71b498",
      "type": "MonthsTicker"
    },
    {
      "id": "0f8788cc-3472-4b53-92e2-e6bbf17fcb21",
      "type": "MonthsTicker"
    },
    {
      "id": "6de5bd37-ba89-4144-b8a2-3b9e3aa0692d",
      "type": "MonthsTicker"
    },
    {
      "id": "a3aeca55-b0e1-4dd0-898f-b4cf6d1e8358",
      "type": "MonthsTicker"
    },
    {
      "id": "58dfbd96-1ba1-4123-81d1-08d0c1858657",
      "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": "63d376fe-a71a-437f-8441-a28723537588",
  "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": "30e8ff34-013b-455b-be2c-b9c9ff09829a",
  "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": "dd5b0c5e-5e53-444e-adc8-bebe73cc1806",
  "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": "319de703-8afc-49db-a352-a6c163ecfb88",
  "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": "bfd3797e-4989-40ac-80ae-848719866d03",
  "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": "606ac439-91da-416d-b795-098ba855eb0e",
  "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": "518d2ac1-599a-4fa5-a723-5587787fcbc5",
  "interval": null,
  "name": null,
  "num_minor_ticks": 5,
  "tags": []
}