bokeh.models.axes

Guide renderers for various kinds of axes that can be added to Bokeh plots

class Axis(**kwargs)

Bases: bokeh.models.renderers.GuideRenderer

A base class that defines common properties for all axis types. Axis is not generally useful to instantiate on its own.

axis_label

property type: axis_label:String

A text label for the axis, displayed parallel to the axis rule.

Note

LaTeX notation is not currently supported; please see issue 647 to track progress or contribute.

axis_label_standoff

property type: axis_label_standoff:Int

The distance in pixels that the axis labels should be offset from the tick labels.

axis_label_text_align

property type: axis_label_text_align:Enum(‘left’, ‘right’, ‘center’)

The text align of the axis label.

axis_label_text_alpha

property type: axis_label_text_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The text alpha of the axis label.

axis_label_text_baseline

property type: axis_label_text_baseline:Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline of the axis label.

axis_label_text_color

property type: axis_label_text_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The text color of the axis label.

axis_label_text_font

property type: axis_label_text_font:String

The text font of the axis label.

axis_label_text_font_size

property type: axis_label_text_font_size:FontSizeSpec(String, Dict(String, Either(String, List(String))), List(String))

The text font size of the axis label.

axis_label_text_font_style

property type: axis_label_text_font_style:Enum(‘normal’, ‘italic’, ‘bold’)

The text font style of the axis label.

axis_line_alpha

property type: axis_line_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line alpha of the axis line.

axis_line_cap

property type: axis_line_cap:Enum(‘butt’, ‘round’, ‘square’)

The line cap of the axis line.

axis_line_color

property type: axis_line_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The line color of the axis line.

axis_line_dash

property type: axis_line_dash:DashPattern

The line dash of the axis line.

axis_line_dash_offset

property type: axis_line_dash_offset:Int

The line dash offset of the axis line.

axis_line_join

property type: axis_line_join:Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the axis line.

axis_line_width

property type: axis_line_width:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line width of the axis line.

bounds

property type: bounds:Either(Auto, Tuple(Float, Float), Tuple(Datetime, Datetime))

Bounds for the rendered axis. If unset, the axis will span the entire plot in the given dimension.

formatter

property type: formatter:Instance(TickFormatter)

A TickFormatter to use for formatting the visual appearance of ticks.

location

property type: location:Either(Auto, Enum(‘above’, ‘below’, ‘left’, ‘right’))

Where should labels and ticks be located in relation to the axis rule.

major_label_orientation

property type: major_label_orientation:Either(Enum(‘horizontal’, ‘vertical’), Float)

What direction the major label text should be oriented. If a i number is supplied, the angle of the text is measured from horizontal.

major_label_standoff

property type: major_label_standoff:Int

The distance in pixels that the major tick labels should be offset from the associated ticks.

major_label_text_align

property type: major_label_text_align:Enum(‘left’, ‘right’, ‘center’)

The text align of the major tick labels.

major_label_text_alpha

property type: major_label_text_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The text alpha of the major tick labels.

major_label_text_baseline

property type: major_label_text_baseline:Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline of the major tick labels.

major_label_text_color

property type: major_label_text_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The text color of the major tick labels.

major_label_text_font

property type: major_label_text_font:String

The text font of the major tick labels.

major_label_text_font_size

property type: major_label_text_font_size:FontSizeSpec(String, Dict(String, Either(String, List(String))), List(String))

The text font size of the major tick labels.

major_label_text_font_style

property type: major_label_text_font_style:Enum(‘normal’, ‘italic’, ‘bold’)

The text font style of the major tick labels.

major_tick_in

property type: major_tick_in:Int

The distance in pixels that major ticks should extend into the main plot area.

major_tick_line_alpha

property type: major_tick_line_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line alpha of the major ticks.

major_tick_line_cap

property type: major_tick_line_cap:Enum(‘butt’, ‘round’, ‘square’)

The line cap of the major ticks.

major_tick_line_color

property type: major_tick_line_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The line color of the major ticks.

major_tick_line_dash

property type: major_tick_line_dash:DashPattern

The line dash of the major ticks.

major_tick_line_dash_offset

property type: major_tick_line_dash_offset:Int

The line dash offset of the major ticks.

major_tick_line_join

property type: major_tick_line_join:Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the major ticks.

major_tick_line_width

property type: major_tick_line_width:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line width of the major ticks.

major_tick_out

property type: major_tick_out:Int

The distance in pixels that major ticks should extend out of the main plot area.

minor_tick_in

property type: minor_tick_in:Int

The distance in pixels that minor ticks should extend into the main plot area.

minor_tick_line_alpha

property type: minor_tick_line_alpha:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line alpha of the minor ticks.

minor_tick_line_cap

property type: minor_tick_line_cap:Enum(‘butt’, ‘round’, ‘square’)

The line cap of the minor ticks.

minor_tick_line_color

property type: minor_tick_line_color:ColorSpec(String, Dict(String, Either(String, Color)), Color)

The line color of the minor ticks.

minor_tick_line_dash

property type: minor_tick_line_dash:DashPattern

The line dash of the minor ticks.

minor_tick_line_dash_offset

property type: minor_tick_line_dash_offset:Int

The line dash offset of the minor ticks.

minor_tick_line_join

property type: minor_tick_line_join:Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the minor ticks.

minor_tick_line_width

property type: minor_tick_line_width:NumberSpec(String, Dict(String, Either(String, Float)), Float)

The line width of the minor ticks.

minor_tick_out

property type: minor_tick_out:Int

The distance in pixels that major ticks should extend out of the main plot area.

ticker

property type: ticker:Instance(Ticker)

A Ticker to use for computing locations of axis components.

visible

property type: visible:Bool

Ability to hide the entire axis from the plot.

x_range_name

property type: x_range_name:String

A particular (named) x-range to use for computing screen locations when rendering an axis on the plot. If unset, use the default x-range.

y_range_name

property type: y_range_name:String

A particular (named) y-range to use for computing screen locations when rendering an axis on the plot. If unset, use the default y-range.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": null,
  "id": "acd5b9af-26bc-4ea9-9ab7-2a205b71c8f3",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": null,
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}
class CategoricalAxis(**kwargs)

Bases: bokeh.models.axes.Axis

An axis that picks evenly spaced tick locations for a collection of categories/factors.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": {
    "id": "47cf09d2-4478-42fa-9fb6-e007adbef675",
    "type": "CategoricalTickFormatter"
  },
  "id": "63c082fd-a54a-476c-b087-495cc91d93ca",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": {
    "id": "5b2adbd0-5c05-4e3b-acf3-96d43a72a53c",
    "type": "CategoricalTicker"
  },
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}
class ContinuousAxis(**kwargs)

Bases: bokeh.models.axes.Axis

A base class for all numeric, non-categorical axes types. ContinuousAxis is not generally useful to instantiate on its own.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": null,
  "id": "23ab30eb-9107-4d4c-a315-0086ea4a312d",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": null,
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}
class DatetimeAxis(**kwargs)

Bases: bokeh.models.axes.LinearAxis

An LinearAxis that picks nice numbers for tick locations on a datetime scale. Configured with a DatetimeTickFormatter by default.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": {
    "id": "593409f2-ef82-4706-9ac3-6788df0185d1",
    "type": "DatetimeTickFormatter"
  },
  "id": "855657d0-2bb4-49d6-a580-5b6566d6d3e2",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": {
    "id": "91ce995e-d3a7-4aee-987d-146337c48cff",
    "type": "DatetimeTicker"
  },
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}
class LinearAxis(**kwargs)

Bases: bokeh.models.axes.ContinuousAxis

An axis that picks nice numbers for tick locations on a linear scale. Configured with a BasicTickFormatter by default.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": {
    "id": "e83d48ef-1af1-41c3-895a-1d50b01c900a",
    "type": "BasicTickFormatter"
  },
  "id": "417cf809-63a7-4d95-b1ab-882c0ad633c8",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": {
    "id": "26bc0f0b-3be1-4bdd-88ca-07c9a2782f7d",
    "type": "BasicTicker"
  },
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}
class LogAxis(**kwargs)

Bases: bokeh.models.axes.ContinuousAxis

An axis that picks nice numbers for tick locations on a log scale. Configured with a LogTickFormatter by default.

JSON Prototype
{
  "axis_label": "",
  "axis_label_standoff": 5,
  "axis_label_text_align": "center",
  "axis_label_text_alpha": {
    "value": 1.0
  },
  "axis_label_text_baseline": "alphabetic",
  "axis_label_text_color": {
    "value": "#444444"
  },
  "axis_label_text_font": "helvetica",
  "axis_label_text_font_size": {
    "value": "16pt"
  },
  "axis_label_text_font_style": "normal",
  "axis_line_alpha": {
    "value": 1.0
  },
  "axis_line_cap": "butt",
  "axis_line_color": {
    "value": "black"
  },
  "axis_line_dash": [],
  "axis_line_dash_offset": 0,
  "axis_line_join": "miter",
  "axis_line_width": {
    "value": 1
  },
  "bounds": "auto",
  "formatter": {
    "id": "e42ab636-2165-4bd3-917d-90781d905322",
    "type": "LogTickFormatter"
  },
  "id": "6fb57812-a0af-4a1b-a93e-9cc9041b90f4",
  "level": "overlay",
  "location": "auto",
  "major_label_orientation": "horizontal",
  "major_label_standoff": 5,
  "major_label_text_align": "center",
  "major_label_text_alpha": {
    "value": 1.0
  },
  "major_label_text_baseline": "alphabetic",
  "major_label_text_color": {
    "value": "#444444"
  },
  "major_label_text_font": "helvetica",
  "major_label_text_font_size": {
    "value": "10pt"
  },
  "major_label_text_font_style": "normal",
  "major_tick_in": 2,
  "major_tick_line_alpha": {
    "value": 1.0
  },
  "major_tick_line_cap": "butt",
  "major_tick_line_color": {
    "value": "black"
  },
  "major_tick_line_dash": [],
  "major_tick_line_dash_offset": 0,
  "major_tick_line_join": "miter",
  "major_tick_line_width": {
    "value": 1
  },
  "major_tick_out": 6,
  "minor_tick_in": 0,
  "minor_tick_line_alpha": {
    "value": 1.0
  },
  "minor_tick_line_cap": "butt",
  "minor_tick_line_color": {
    "value": "black"
  },
  "minor_tick_line_dash": [],
  "minor_tick_line_dash_offset": 0,
  "minor_tick_line_join": "miter",
  "minor_tick_line_width": {
    "value": 1
  },
  "minor_tick_out": 4,
  "name": null,
  "plot": null,
  "tags": [],
  "ticker": {
    "id": "39302001-6a66-492f-ad80-b4ea949c6bdb",
    "type": "LogTicker"
  },
  "visible": true,
  "x_range_name": "default",
  "y_range_name": "default"
}